index int64 0 0 | repo_id stringlengths 9 205 | file_path stringlengths 31 246 | content stringlengths 1 12.2M | __index_level_0__ int64 0 10k |
|---|---|---|---|---|
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/mapofenumtoenumcopier.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import static java.util.stream.Collectors.toMap;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.Map;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
@Generated("software.amazon.awssdk:codegen")
final class MapOfEnumToEnumCopier {
static Map<String, String> copy(Map<String, String> mapOfEnumToEnumParam) {
Map<String, String> map;
if (mapOfEnumToEnumParam == null || mapOfEnumToEnumParam instanceof SdkAutoConstructMap) {
map = DefaultSdkAutoConstructMap.getInstance();
} else {
Map<String, String> modifiableMap = new LinkedHashMap<>();
mapOfEnumToEnumParam.forEach((key, value) -> {
modifiableMap.put(key, value);
});
map = Collections.unmodifiableMap(modifiableMap);
}
return map;
}
static Map<String, String> copyEnumToString(Map<EnumType, EnumType> mapOfEnumToEnumParam) {
Map<String, String> map;
if (mapOfEnumToEnumParam == null || mapOfEnumToEnumParam instanceof SdkAutoConstructMap) {
map = DefaultSdkAutoConstructMap.getInstance();
} else {
Map<String, String> modifiableMap = new LinkedHashMap<>();
mapOfEnumToEnumParam.forEach((key, value) -> {
String result = key.toString();
String result1 = value.toString();
modifiableMap.put(result, result1);
});
map = Collections.unmodifiableMap(modifiableMap);
}
return map;
}
static Map<EnumType, EnumType> copyStringToEnum(Map<String, String> mapOfEnumToEnumParam) {
Map<EnumType, EnumType> map;
if (mapOfEnumToEnumParam == null || mapOfEnumToEnumParam instanceof SdkAutoConstructMap) {
map = DefaultSdkAutoConstructMap.getInstance();
} else {
Map<EnumType, EnumType> modifiableMap = new LinkedHashMap<>();
mapOfEnumToEnumParam.forEach((key, value) -> {
EnumType result = EnumType.fromValue(key);
EnumType result1 = EnumType.fromValue(value);
if (result != EnumType.UNKNOWN_TO_SDK_VERSION) {
modifiableMap.put(result, result1);
}
});
map = Collections.unmodifiableMap(modifiableMap);
}
return map;
}
}
| 3,400 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/emptymodeledexception.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
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.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class EmptyModeledException extends JsonProtocolTestsException implements
ToCopyableBuilder<EmptyModeledException.Builder, EmptyModeledException> {
private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList());
private static final long serialVersionUID = 1L;
private EmptyModeledException(BuilderImpl builder) {
super(builder);
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class<? extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
public interface Builder extends SdkPojo, CopyableBuilder<Builder, EmptyModeledException>, JsonProtocolTestsException.Builder {
@Override
Builder awsErrorDetails(AwsErrorDetails awsErrorDetails);
@Override
Builder message(String message);
@Override
Builder requestId(String requestId);
@Override
Builder statusCode(int statusCode);
@Override
Builder cause(Throwable cause);
@Override
Builder writableStackTrace(Boolean writableStackTrace);
}
static final class BuilderImpl extends JsonProtocolTestsException.BuilderImpl implements Builder {
private BuilderImpl() {
}
private BuilderImpl(EmptyModeledException model) {
super(model);
}
@Override
public BuilderImpl awsErrorDetails(AwsErrorDetails awsErrorDetails) {
this.awsErrorDetails = awsErrorDetails;
return this;
}
@Override
public BuilderImpl message(String message) {
this.message = message;
return this;
}
@Override
public BuilderImpl requestId(String requestId) {
this.requestId = requestId;
return this;
}
@Override
public BuilderImpl statusCode(int statusCode) {
this.statusCode = statusCode;
return this;
}
@Override
public BuilderImpl cause(Throwable cause) {
this.cause = cause;
return this;
}
@Override
public BuilderImpl writableStackTrace(Boolean writableStackTrace) {
this.writableStackTrace = writableStackTrace;
return this;
}
@Override
public EmptyModeledException build() {
return new EmptyModeledException(this);
}
@Override
public List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
}
}
| 3,401 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/existencechecknamingresponse.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
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.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.traits.MapTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class ExistenceCheckNamingResponse extends JsonProtocolTestsResponse implements
ToCopyableBuilder<ExistenceCheckNamingResponse.Builder, ExistenceCheckNamingResponse> {
private static final SdkField<List<String>> BUILD_FIELD = SdkField
.<List<String>> builder(MarshallingType.LIST)
.memberName("Build")
.getter(getter(ExistenceCheckNamingResponse::build))
.setter(setter(Builder::build))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Build").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField<List<String>> SUPER_FIELD = SdkField
.<List<String>> builder(MarshallingType.LIST)
.memberName("super")
.getter(getter(ExistenceCheckNamingResponse::superValue))
.setter(setter(Builder::superValue))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("super").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField<Map<String, String>> TO_STRING_FIELD = SdkField
.<Map<String, String>> builder(MarshallingType.MAP)
.memberName("toString")
.getter(getter(ExistenceCheckNamingResponse::toStringValue))
.setter(setter(Builder::toStringValue))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("toString").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build()).build()).build();
private static final SdkField<Map<String, String>> EQUALS_FIELD = SdkField
.<Map<String, String>> builder(MarshallingType.MAP)
.memberName("equals")
.getter(getter(ExistenceCheckNamingResponse::equalsValue))
.setter(setter(Builder::equalsValue))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("equals").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build()).build()).build();
private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(BUILD_FIELD, SUPER_FIELD,
TO_STRING_FIELD, EQUALS_FIELD));
private final List<String> build;
private final List<String> superValue;
private final Map<String, String> toStringValue;
private final Map<String, String> equalsValue;
private ExistenceCheckNamingResponse(BuilderImpl builder) {
super(builder);
this.build = builder.build;
this.superValue = builder.superValue;
this.toStringValue = builder.toStringValue;
this.equalsValue = builder.equalsValue;
}
/**
* For responses, this returns true if the service returned a value for the Build property. This DOES NOT check that
* the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is useful
* because the SDK will never return a null collection or map, but you may need to differentiate between the service
* returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true
* if a value for the property was specified in the request builder, and false if a value was not specified.
*/
public final boolean hasBuild() {
return build != null && !(build instanceof SdkAutoConstructList);
}
/**
* Returns the value of the Build property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasBuild} method.
* </p>
*
* @return The value of the Build property for this object.
*/
public final List<String> build() {
return build;
}
/**
* For responses, this returns true if the service returned a value for the Super property. This DOES NOT check that
* the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is useful
* because the SDK will never return a null collection or map, but you may need to differentiate between the service
* returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true
* if a value for the property was specified in the request builder, and false if a value was not specified.
*/
public final boolean hasSuperValue() {
return superValue != null && !(superValue instanceof SdkAutoConstructList);
}
/**
* Returns the value of the Super property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasSuperValue} method.
* </p>
*
* @return The value of the Super property for this object.
*/
public final List<String> superValue() {
return superValue;
}
/**
* For responses, this returns true if the service returned a value for the ToString property. This DOES NOT check
* that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is
* useful because the SDK will never return a null collection or map, but you may need to differentiate between the
* service returning nothing (or null) and the service returning an empty collection or map. For requests, this
* returns true if a value for the property was specified in the request builder, and false if a value was not
* specified.
*/
public final boolean hasToStringValue() {
return toStringValue != null && !(toStringValue instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the ToString property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasToStringValue} method.
* </p>
*
* @return The value of the ToString property for this object.
*/
public final Map<String, String> toStringValue() {
return toStringValue;
}
/**
* For responses, this returns true if the service returned a value for the Equals property. This DOES NOT check
* that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is
* useful because the SDK will never return a null collection or map, but you may need to differentiate between the
* service returning nothing (or null) and the service returning an empty collection or map. For requests, this
* returns true if a value for the property was specified in the request builder, and false if a value was not
* specified.
*/
public final boolean hasEqualsValue() {
return equalsValue != null && !(equalsValue instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the Equals property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasEqualsValue} method.
* </p>
*
* @return The value of the Equals property for this object.
*/
public final Map<String, String> equalsValue() {
return equalsValue;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class<? extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
hashCode = 31 * hashCode + Objects.hashCode(hasBuild() ? build() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasSuperValue() ? superValue() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasToStringValue() ? toStringValue() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasEqualsValue() ? equalsValue() : null);
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof ExistenceCheckNamingResponse)) {
return false;
}
ExistenceCheckNamingResponse other = (ExistenceCheckNamingResponse) obj;
return hasBuild() == other.hasBuild() && Objects.equals(build(), other.build())
&& hasSuperValue() == other.hasSuperValue() && Objects.equals(superValue(), other.superValue())
&& hasToStringValue() == other.hasToStringValue() && Objects.equals(toStringValue(), other.toStringValue())
&& hasEqualsValue() == other.hasEqualsValue() && Objects.equals(equalsValue(), other.equalsValue());
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("ExistenceCheckNamingResponse").add("Build", hasBuild() ? build() : null)
.add("Super", hasSuperValue() ? superValue() : null).add("ToString", hasToStringValue() ? toStringValue() : null)
.add("Equals", hasEqualsValue() ? equalsValue() : null).build();
}
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
switch (fieldName) {
case "Build":
return Optional.ofNullable(clazz.cast(build()));
case "super":
return Optional.ofNullable(clazz.cast(superValue()));
case "toString":
return Optional.ofNullable(clazz.cast(toStringValue()));
case "equals":
return Optional.ofNullable(clazz.cast(equalsValue()));
default:
return Optional.empty();
}
}
@Override
public final List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
private static <T> Function<Object, T> getter(Function<ExistenceCheckNamingResponse, T> g) {
return obj -> g.apply((ExistenceCheckNamingResponse) obj);
}
private static <T> BiConsumer<Object, T> setter(BiConsumer<Builder, T> s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
public interface Builder extends JsonProtocolTestsResponse.Builder, SdkPojo,
CopyableBuilder<Builder, ExistenceCheckNamingResponse> {
/**
* Sets the value of the Build property for this object.
*
* @param build
* The new value for the Build property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder build(Collection<String> build);
/**
* Sets the value of the Build property for this object.
*
* @param build
* The new value for the Build property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder build(String... build);
/**
* Sets the value of the Super property for this object.
*
* @param superValue
* The new value for the Super property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder superValue(Collection<String> superValue);
/**
* Sets the value of the Super property for this object.
*
* @param superValue
* The new value for the Super property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder superValue(String... superValue);
/**
* Sets the value of the ToString property for this object.
*
* @param toStringValue
* The new value for the ToString property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder toStringValue(Map<String, String> toStringValue);
/**
* Sets the value of the Equals property for this object.
*
* @param equalsValue
* The new value for the Equals property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder equalsValue(Map<String, String> equalsValue);
}
static final class BuilderImpl extends JsonProtocolTestsResponse.BuilderImpl implements Builder {
private List<String> build = DefaultSdkAutoConstructList.getInstance();
private List<String> superValue = DefaultSdkAutoConstructList.getInstance();
private Map<String, String> toStringValue = DefaultSdkAutoConstructMap.getInstance();
private Map<String, String> equalsValue = DefaultSdkAutoConstructMap.getInstance();
private BuilderImpl() {
}
private BuilderImpl(ExistenceCheckNamingResponse model) {
super(model);
build(model.build);
superValue(model.superValue);
toStringValue(model.toStringValue);
equalsValue(model.equalsValue);
}
public final Collection<String> getBuild() {
if (build instanceof SdkAutoConstructList) {
return null;
}
return build;
}
public final void setBuild(Collection<String> build) {
this.build = ListOfStringsCopier.copy(build);
}
@Override
public final Builder build(Collection<String> build) {
this.build = ListOfStringsCopier.copy(build);
return this;
}
@Override
@SafeVarargs
public final Builder build(String... build) {
build(Arrays.asList(build));
return this;
}
public final Collection<String> getSuperValue() {
if (superValue instanceof SdkAutoConstructList) {
return null;
}
return superValue;
}
public final void setSuperValue(Collection<String> superValue) {
this.superValue = ListOfStringsCopier.copy(superValue);
}
@Override
public final Builder superValue(Collection<String> superValue) {
this.superValue = ListOfStringsCopier.copy(superValue);
return this;
}
@Override
@SafeVarargs
public final Builder superValue(String... superValue) {
superValue(Arrays.asList(superValue));
return this;
}
public final Map<String, String> getToStringValue() {
if (toStringValue instanceof SdkAutoConstructMap) {
return null;
}
return toStringValue;
}
public final void setToStringValue(Map<String, String> toStringValue) {
this.toStringValue = MapOfStringToStringCopier.copy(toStringValue);
}
@Override
public final Builder toStringValue(Map<String, String> toStringValue) {
this.toStringValue = MapOfStringToStringCopier.copy(toStringValue);
return this;
}
public final Map<String, String> getEqualsValue() {
if (equalsValue instanceof SdkAutoConstructMap) {
return null;
}
return equalsValue;
}
public final void setEqualsValue(Map<String, String> equalsValue) {
this.equalsValue = MapOfStringToStringCopier.copy(equalsValue);
}
@Override
public final Builder equalsValue(Map<String, String> equalsValue) {
this.equalsValue = MapOfStringToStringCopier.copy(equalsValue);
return this;
}
@Override
public ExistenceCheckNamingResponse build() {
return new ExistenceCheckNamingResponse(this);
}
@Override
public List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
}
}
| 3,402 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/eventstreamoperationwithonlyinputresponse.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
@Generated("software.amazon.awssdk:codegen")
public final class EventStreamOperationWithOnlyInputResponse extends JsonProtocolTestsResponse implements
ToCopyableBuilder<EventStreamOperationWithOnlyInputResponse.Builder, EventStreamOperationWithOnlyInputResponse> {
private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList());
private EventStreamOperationWithOnlyInputResponse(BuilderImpl builder) {
super(builder);
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class<? extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof EventStreamOperationWithOnlyInputResponse)) {
return false;
}
return true;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("EventStreamOperationWithOnlyInputResponse").build();
}
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
return Optional.empty();
}
@Override
public final List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
public interface Builder extends JsonProtocolTestsResponse.Builder, SdkPojo,
CopyableBuilder<Builder, EventStreamOperationWithOnlyInputResponse> {
}
static final class BuilderImpl extends JsonProtocolTestsResponse.BuilderImpl implements Builder {
private BuilderImpl() {
}
private BuilderImpl(EventStreamOperationWithOnlyInputResponse model) {
super(model);
}
@Override
public EventStreamOperationWithOnlyInputResponse build() {
return new EventStreamOperationWithOnlyInputResponse(this);
}
@Override
public List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
}
}
| 3,403 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/mapofenumtolistofenumscopier.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import static java.util.stream.Collectors.toMap;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
@Generated("software.amazon.awssdk:codegen")
final class MapOfEnumToListOfEnumsCopier {
static Map<String, List<String>> copy(Map<String, ? extends Collection<String>> mapOfEnumToListOfEnumsParam) {
Map<String, List<String>> map;
if (mapOfEnumToListOfEnumsParam == null || mapOfEnumToListOfEnumsParam instanceof SdkAutoConstructMap) {
map = DefaultSdkAutoConstructMap.getInstance();
} else {
Map<String, List<String>> modifiableMap = new LinkedHashMap<>();
mapOfEnumToListOfEnumsParam.forEach((key, value) -> {
List<String> list;
if (value == null || value instanceof SdkAutoConstructList) {
list = DefaultSdkAutoConstructList.getInstance();
} else {
List<String> modifiableList = new ArrayList<>();
value.forEach(entry -> {
modifiableList.add(entry);
});
list = Collections.unmodifiableList(modifiableList);
}
modifiableMap.put(key, list);
});
map = Collections.unmodifiableMap(modifiableMap);
}
return map;
}
static Map<String, List<String>> copyEnumToString(Map<EnumType, ? extends Collection<EnumType>> mapOfEnumToListOfEnumsParam) {
Map<String, List<String>> map;
if (mapOfEnumToListOfEnumsParam == null || mapOfEnumToListOfEnumsParam instanceof SdkAutoConstructMap) {
map = DefaultSdkAutoConstructMap.getInstance();
} else {
Map<String, List<String>> modifiableMap = new LinkedHashMap<>();
mapOfEnumToListOfEnumsParam.forEach((key, value) -> {
String result = key.toString();
List<String> list;
if (value == null || value instanceof SdkAutoConstructList) {
list = DefaultSdkAutoConstructList.getInstance();
} else {
List<String> modifiableList = new ArrayList<>();
value.forEach(entry -> {
String result1 = entry.toString();
modifiableList.add(result1);
});
list = Collections.unmodifiableList(modifiableList);
}
modifiableMap.put(result, list);
});
map = Collections.unmodifiableMap(modifiableMap);
}
return map;
}
static Map<EnumType, List<EnumType>> copyStringToEnum(Map<String, ? extends Collection<String>> mapOfEnumToListOfEnumsParam) {
Map<EnumType, List<EnumType>> map;
if (mapOfEnumToListOfEnumsParam == null || mapOfEnumToListOfEnumsParam instanceof SdkAutoConstructMap) {
map = DefaultSdkAutoConstructMap.getInstance();
} else {
Map<EnumType, List<EnumType>> modifiableMap = new LinkedHashMap<>();
mapOfEnumToListOfEnumsParam.forEach((key, value) -> {
EnumType result = EnumType.fromValue(key);
List<EnumType> list;
if (value == null || value instanceof SdkAutoConstructList) {
list = DefaultSdkAutoConstructList.getInstance();
} else {
List<EnumType> modifiableList = new ArrayList<>();
value.forEach(entry -> {
EnumType result1 = EnumType.fromValue(entry);
modifiableList.add(result1);
});
list = Collections.unmodifiableList(modifiableList);
}
if (result != EnumType.UNKNOWN_TO_SDK_VERSION) {
modifiableMap.put(result, list);
}
});
map = Collections.unmodifiableMap(modifiableMap);
}
return map;
}
}
| 3,404 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/jsonprotocoltestsresponse.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.awscore.AwsResponse;
import software.amazon.awssdk.awscore.AwsResponseMetadata;
@Generated("software.amazon.awssdk:codegen")
public abstract class JsonProtocolTestsResponse extends AwsResponse {
private final JsonProtocolTestsResponseMetadata responseMetadata;
protected JsonProtocolTestsResponse(Builder builder) {
super(builder);
this.responseMetadata = builder.responseMetadata();
}
@Override
public JsonProtocolTestsResponseMetadata responseMetadata() {
return responseMetadata;
}
public interface Builder extends AwsResponse.Builder {
@Override
JsonProtocolTestsResponse build();
@Override
JsonProtocolTestsResponseMetadata responseMetadata();
@Override
Builder responseMetadata(AwsResponseMetadata metadata);
}
protected abstract static class BuilderImpl extends AwsResponse.BuilderImpl implements Builder {
private JsonProtocolTestsResponseMetadata responseMetadata;
protected BuilderImpl() {
}
protected BuilderImpl(JsonProtocolTestsResponse response) {
super(response);
this.responseMetadata = response.responseMetadata();
}
@Override
public JsonProtocolTestsResponseMetadata responseMetadata() {
return responseMetadata;
}
@Override
public Builder responseMetadata(AwsResponseMetadata responseMetadata) {
this.responseMetadata = JsonProtocolTestsResponseMetadata.create(responseMetadata);
return this;
}
}
}
| 3,405 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/deprecatedrenamerequest.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
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.AwsRequestOverrideConfiguration;
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.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class DeprecatedRenameRequest extends JsonProtocolTestsRequest implements
ToCopyableBuilder<DeprecatedRenameRequest.Builder, DeprecatedRenameRequest> {
private static final SdkField<String> NEW_NAME_NO_DEPRECATION_FIELD = SdkField.<String> builder(MarshallingType.STRING)
.memberName("NewNameNoDeprecation").getter(getter(DeprecatedRenameRequest::newNameNoDeprecation))
.setter(setter(Builder::newNameNoDeprecation))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("OriginalNameNoDeprecation").build())
.build();
private static final SdkField<String> NEW_NAME_FIELD = SdkField.<String> builder(MarshallingType.STRING)
.memberName("NewName").getter(getter(DeprecatedRenameRequest::newName)).setter(setter(Builder::newName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("OriginalNameDeprecated").build())
.build();
private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(NEW_NAME_NO_DEPRECATION_FIELD,
NEW_NAME_FIELD));
private final String newNameNoDeprecation;
private final String newName;
private DeprecatedRenameRequest(BuilderImpl builder) {
super(builder);
this.newNameNoDeprecation = builder.newNameNoDeprecation;
this.newName = builder.newName;
}
/**
* Returns the value of the NewNameNoDeprecation property for this object.
*
* @return The value of the NewNameNoDeprecation property for this object.
*/
public final String newNameNoDeprecation() {
return newNameNoDeprecation;
}
/**
* Returns the value of the NewName property for this object.
*
* @return The value of the NewName property for this object.
* @deprecated Use {@link #newName()}
*/
@Deprecated
public final String originalNameDeprecated() {
return newName;
}
/**
* Returns the value of the NewName property for this object.
*
* @return The value of the NewName property for this object.
*/
public final String newName() {
return newName;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class<? extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
hashCode = 31 * hashCode + Objects.hashCode(newNameNoDeprecation());
hashCode = 31 * hashCode + Objects.hashCode(newName());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof DeprecatedRenameRequest)) {
return false;
}
DeprecatedRenameRequest other = (DeprecatedRenameRequest) obj;
return Objects.equals(newNameNoDeprecation(), other.newNameNoDeprecation()) && Objects.equals(newName(), other.newName());
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("DeprecatedRenameRequest").add("NewNameNoDeprecation", newNameNoDeprecation())
.add("NewName", newName()).build();
}
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
switch (fieldName) {
case "NewNameNoDeprecation":
return Optional.ofNullable(clazz.cast(newNameNoDeprecation()));
case "NewName":
return Optional.ofNullable(clazz.cast(newName()));
case "OriginalNameDeprecated":
return Optional.ofNullable(clazz.cast(newName()));
default:
return Optional.empty();
}
}
@Override
public final List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
private static <T> Function<Object, T> getter(Function<DeprecatedRenameRequest, T> g) {
return obj -> g.apply((DeprecatedRenameRequest) obj);
}
private static <T> BiConsumer<Object, T> setter(BiConsumer<Builder, T> s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
public interface Builder extends JsonProtocolTestsRequest.Builder, SdkPojo, CopyableBuilder<Builder, DeprecatedRenameRequest> {
/**
* Sets the value of the NewNameNoDeprecation property for this object.
*
* @param newNameNoDeprecation
* The new value for the NewNameNoDeprecation property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder newNameNoDeprecation(String newNameNoDeprecation);
/**
* Sets the value of the NewName property for this object.
*
* @param newName
* The new value for the NewName property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder newName(String newName);
/**
* Sets the value of the NewName property for this object.
*
* @param newName
* The new value for the NewName property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
* @deprecated Use {@link #newName(String)}
*/
@Deprecated
Builder originalNameDeprecated(String newName);
@Override
Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration);
@Override
Builder overrideConfiguration(Consumer<AwsRequestOverrideConfiguration.Builder> builderConsumer);
}
static final class BuilderImpl extends JsonProtocolTestsRequest.BuilderImpl implements Builder {
private String newNameNoDeprecation;
private String newName;
private BuilderImpl() {
}
private BuilderImpl(DeprecatedRenameRequest model) {
super(model);
newNameNoDeprecation(model.newNameNoDeprecation);
newName(model.newName);
}
public final String getNewNameNoDeprecation() {
return newNameNoDeprecation;
}
public final void setNewNameNoDeprecation(String newNameNoDeprecation) {
this.newNameNoDeprecation = newNameNoDeprecation;
}
@Override
public final Builder newNameNoDeprecation(String newNameNoDeprecation) {
this.newNameNoDeprecation = newNameNoDeprecation;
return this;
}
public final String getNewName() {
return newName;
}
public final void setNewName(String newName) {
this.newName = newName;
}
/**
* @deprecated Use {@link #setNewName} instead
*/
@Deprecated
public final void setOriginalNameDeprecated(String newName) {
this.newName = newName;
}
@Override
public final Builder newName(String newName) {
this.newName = newName;
return this;
}
@Override
public final Builder originalNameDeprecated(String newName) {
this.newName = newName;
return this;
}
@Override
public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) {
super.overrideConfiguration(overrideConfiguration);
return this;
}
@Override
public Builder overrideConfiguration(Consumer<AwsRequestOverrideConfiguration.Builder> builderConsumer) {
super.overrideConfiguration(builderConsumer);
return this;
}
@Override
public DeprecatedRenameRequest build() {
return new DeprecatedRenameRequest(this);
}
@Override
public List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
}
}
| 3,406 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/deprecatedrenameresponse.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
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.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class DeprecatedRenameResponse extends JsonProtocolTestsResponse implements
ToCopyableBuilder<DeprecatedRenameResponse.Builder, DeprecatedRenameResponse> {
private static final SdkField<String> ORIGINAL_NAME_NO_DEPRECATION_FIELD = SdkField.<String> builder(MarshallingType.STRING)
.memberName("OriginalNameNoDeprecation").getter(getter(DeprecatedRenameResponse::originalNameNoDeprecation))
.setter(setter(Builder::originalNameNoDeprecation))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("OriginalNameNoDeprecation").build())
.build();
private static final SdkField<String> ORIGINAL_NAME_DEPRECATED_FIELD = SdkField.<String> builder(MarshallingType.STRING)
.memberName("OriginalNameDeprecated").getter(getter(DeprecatedRenameResponse::originalNameDeprecated))
.setter(setter(Builder::originalNameDeprecated))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("OriginalNameDeprecated").build())
.build();
private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(
ORIGINAL_NAME_NO_DEPRECATION_FIELD, ORIGINAL_NAME_DEPRECATED_FIELD));
private final String originalNameNoDeprecation;
private final String originalNameDeprecated;
private DeprecatedRenameResponse(BuilderImpl builder) {
super(builder);
this.originalNameNoDeprecation = builder.originalNameNoDeprecation;
this.originalNameDeprecated = builder.originalNameDeprecated;
}
/**
* Returns the value of the OriginalNameNoDeprecation property for this object.
*
* @return The value of the OriginalNameNoDeprecation property for this object.
*/
public final String originalNameNoDeprecation() {
return originalNameNoDeprecation;
}
/**
* Returns the value of the OriginalNameDeprecated property for this object.
*
* @return The value of the OriginalNameDeprecated property for this object.
*/
public final String originalNameDeprecated() {
return originalNameDeprecated;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class<? extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
hashCode = 31 * hashCode + Objects.hashCode(originalNameNoDeprecation());
hashCode = 31 * hashCode + Objects.hashCode(originalNameDeprecated());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof DeprecatedRenameResponse)) {
return false;
}
DeprecatedRenameResponse other = (DeprecatedRenameResponse) obj;
return Objects.equals(originalNameNoDeprecation(), other.originalNameNoDeprecation())
&& Objects.equals(originalNameDeprecated(), other.originalNameDeprecated());
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("DeprecatedRenameResponse").add("OriginalNameNoDeprecation", originalNameNoDeprecation())
.add("OriginalNameDeprecated", originalNameDeprecated()).build();
}
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
switch (fieldName) {
case "OriginalNameNoDeprecation":
return Optional.ofNullable(clazz.cast(originalNameNoDeprecation()));
case "OriginalNameDeprecated":
return Optional.ofNullable(clazz.cast(originalNameDeprecated()));
default:
return Optional.empty();
}
}
@Override
public final List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
private static <T> Function<Object, T> getter(Function<DeprecatedRenameResponse, T> g) {
return obj -> g.apply((DeprecatedRenameResponse) obj);
}
private static <T> BiConsumer<Object, T> setter(BiConsumer<Builder, T> s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
public interface Builder extends JsonProtocolTestsResponse.Builder, SdkPojo,
CopyableBuilder<Builder, DeprecatedRenameResponse> {
/**
* Sets the value of the OriginalNameNoDeprecation property for this object.
*
* @param originalNameNoDeprecation
* The new value for the OriginalNameNoDeprecation property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder originalNameNoDeprecation(String originalNameNoDeprecation);
/**
* Sets the value of the OriginalNameDeprecated property for this object.
*
* @param originalNameDeprecated
* The new value for the OriginalNameDeprecated property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder originalNameDeprecated(String originalNameDeprecated);
}
static final class BuilderImpl extends JsonProtocolTestsResponse.BuilderImpl implements Builder {
private String originalNameNoDeprecation;
private String originalNameDeprecated;
private BuilderImpl() {
}
private BuilderImpl(DeprecatedRenameResponse model) {
super(model);
originalNameNoDeprecation(model.originalNameNoDeprecation);
originalNameDeprecated(model.originalNameDeprecated);
}
public final String getOriginalNameNoDeprecation() {
return originalNameNoDeprecation;
}
public final void setOriginalNameNoDeprecation(String originalNameNoDeprecation) {
this.originalNameNoDeprecation = originalNameNoDeprecation;
}
@Override
public final Builder originalNameNoDeprecation(String originalNameNoDeprecation) {
this.originalNameNoDeprecation = originalNameNoDeprecation;
return this;
}
public final String getOriginalNameDeprecated() {
return originalNameDeprecated;
}
public final void setOriginalNameDeprecated(String originalNameDeprecated) {
this.originalNameDeprecated = originalNameDeprecated;
}
@Override
public final Builder originalNameDeprecated(String originalNameDeprecated) {
this.originalNameDeprecated = originalNameDeprecated;
return this;
}
@Override
public DeprecatedRenameResponse build() {
return new DeprecatedRenameResponse(this);
}
@Override
public List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
}
}
| 3,407 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/operationwithnoinputoroutputrequest.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
import java.util.function.Consumer;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
@Generated("software.amazon.awssdk:codegen")
public final class OperationWithNoInputOrOutputRequest extends JsonProtocolTestsRequest implements
ToCopyableBuilder<OperationWithNoInputOrOutputRequest.Builder, OperationWithNoInputOrOutputRequest> {
private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList());
private OperationWithNoInputOrOutputRequest(BuilderImpl builder) {
super(builder);
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class<? extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof OperationWithNoInputOrOutputRequest)) {
return false;
}
return true;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("OperationWithNoInputOrOutputRequest").build();
}
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
return Optional.empty();
}
@Override
public final List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
public interface Builder extends JsonProtocolTestsRequest.Builder, SdkPojo,
CopyableBuilder<Builder, OperationWithNoInputOrOutputRequest> {
@Override
Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration);
@Override
Builder overrideConfiguration(Consumer<AwsRequestOverrideConfiguration.Builder> builderConsumer);
}
static final class BuilderImpl extends JsonProtocolTestsRequest.BuilderImpl implements Builder {
private BuilderImpl() {
}
private BuilderImpl(OperationWithNoInputOrOutputRequest model) {
super(model);
}
@Override
public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) {
super.overrideConfiguration(overrideConfiguration);
return this;
}
@Override
public Builder overrideConfiguration(Consumer<AwsRequestOverrideConfiguration.Builder> builderConsumer) {
super.overrideConfiguration(builderConsumer);
return this;
}
@Override
public OperationWithNoInputOrOutputRequest build() {
return new OperationWithNoInputOrOutputRequest(this);
}
@Override
public List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
}
}
| 3,408 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/streamingoutputoperationresponse.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class StreamingOutputOperationResponse extends JsonProtocolTestsResponse implements
ToCopyableBuilder<StreamingOutputOperationResponse.Builder, StreamingOutputOperationResponse> {
private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList());
private StreamingOutputOperationResponse(BuilderImpl builder) {
super(builder);
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class<? extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof StreamingOutputOperationResponse)) {
return false;
}
return true;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("StreamingOutputOperationResponse").build();
}
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
return Optional.empty();
}
@Override
public final List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
public interface Builder extends JsonProtocolTestsResponse.Builder, SdkPojo,
CopyableBuilder<Builder, StreamingOutputOperationResponse> {
}
static final class BuilderImpl extends JsonProtocolTestsResponse.BuilderImpl implements Builder {
private BuilderImpl() {
}
private BuilderImpl(StreamingOutputOperationResponse model) {
super(model);
}
@Override
public StreamingOutputOperationResponse build() {
return new StreamingOutputOperationResponse(this);
}
@Override
public List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
}
}
| 3,409 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/streaminginputoperationresponse.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
@Generated("software.amazon.awssdk:codegen")
public final class StreamingInputOperationResponse extends JsonProtocolTestsResponse implements
ToCopyableBuilder<StreamingInputOperationResponse.Builder, StreamingInputOperationResponse> {
private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList());
private StreamingInputOperationResponse(BuilderImpl builder) {
super(builder);
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class<? extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof StreamingInputOperationResponse)) {
return false;
}
return true;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("StreamingInputOperationResponse").build();
}
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
return Optional.empty();
}
@Override
public final List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
public interface Builder extends JsonProtocolTestsResponse.Builder, SdkPojo,
CopyableBuilder<Builder, StreamingInputOperationResponse> {
}
static final class BuilderImpl extends JsonProtocolTestsResponse.BuilderImpl implements Builder {
private BuilderImpl() {
}
private BuilderImpl(StreamingInputOperationResponse model) {
super(model);
}
@Override
public StreamingInputOperationResponse build() {
return new StreamingInputOperationResponse(this);
}
@Override
public List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
}
}
| 3,410 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/mapofenumtosimplestructcopier.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import static java.util.stream.Collectors.toMap;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.Map;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
@Generated("software.amazon.awssdk:codegen")
final class MapOfEnumToSimpleStructCopier {
static Map<String, SimpleStruct> copy(Map<String, ? extends SimpleStruct> mapOfEnumToSimpleStructParam) {
Map<String, SimpleStruct> map;
if (mapOfEnumToSimpleStructParam == null || mapOfEnumToSimpleStructParam instanceof SdkAutoConstructMap) {
map = DefaultSdkAutoConstructMap.getInstance();
} else {
Map<String, SimpleStruct> modifiableMap = new LinkedHashMap<>();
mapOfEnumToSimpleStructParam.forEach((key, value) -> {
modifiableMap.put(key, value);
});
map = Collections.unmodifiableMap(modifiableMap);
}
return map;
}
static Map<String, SimpleStruct> copyFromBuilder(Map<String, ? extends SimpleStruct.Builder> mapOfEnumToSimpleStructParam) {
Map<String, SimpleStruct> map;
if (mapOfEnumToSimpleStructParam == null || mapOfEnumToSimpleStructParam instanceof SdkAutoConstructMap) {
map = DefaultSdkAutoConstructMap.getInstance();
} else {
Map<String, SimpleStruct> modifiableMap = new LinkedHashMap<>();
mapOfEnumToSimpleStructParam.forEach((key, value) -> {
SimpleStruct member = value == null ? null : value.build();
modifiableMap.put(key, member);
});
map = Collections.unmodifiableMap(modifiableMap);
}
return map;
}
static Map<String, SimpleStruct.Builder> copyToBuilder(Map<String, ? extends SimpleStruct> mapOfEnumToSimpleStructParam) {
Map<String, SimpleStruct.Builder> map;
if (mapOfEnumToSimpleStructParam == null || mapOfEnumToSimpleStructParam instanceof SdkAutoConstructMap) {
map = DefaultSdkAutoConstructMap.getInstance();
} else {
Map<String, SimpleStruct.Builder> modifiableMap = new LinkedHashMap<>();
mapOfEnumToSimpleStructParam.forEach((key, value) -> {
SimpleStruct.Builder member = value == null ? null : value.toBuilder();
modifiableMap.put(key, member);
});
map = Collections.unmodifiableMap(modifiableMap);
}
return map;
}
static Map<String, SimpleStruct> copyEnumToString(Map<EnumType, ? extends SimpleStruct> mapOfEnumToSimpleStructParam) {
Map<String, SimpleStruct> map;
if (mapOfEnumToSimpleStructParam == null || mapOfEnumToSimpleStructParam instanceof SdkAutoConstructMap) {
map = DefaultSdkAutoConstructMap.getInstance();
} else {
Map<String, SimpleStruct> modifiableMap = new LinkedHashMap<>();
mapOfEnumToSimpleStructParam.forEach((key, value) -> {
String result = key.toString();
modifiableMap.put(result, value);
});
map = Collections.unmodifiableMap(modifiableMap);
}
return map;
}
static Map<EnumType, SimpleStruct> copyStringToEnum(Map<String, ? extends SimpleStruct> mapOfEnumToSimpleStructParam) {
Map<EnumType, SimpleStruct> map;
if (mapOfEnumToSimpleStructParam == null || mapOfEnumToSimpleStructParam instanceof SdkAutoConstructMap) {
map = DefaultSdkAutoConstructMap.getInstance();
} else {
Map<EnumType, SimpleStruct> modifiableMap = new LinkedHashMap<>();
mapOfEnumToSimpleStructParam.forEach((key, value) -> {
EnumType result = EnumType.fromValue(key);
if (result != EnumType.UNKNOWN_TO_SDK_VERSION) {
modifiableMap.put(result, value);
}
});
map = Collections.unmodifiableMap(modifiableMap);
}
return map;
}
}
| 3,411 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/nestedcontainersresponse.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
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.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.traits.MapTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class NestedContainersResponse extends JsonProtocolTestsResponse implements
ToCopyableBuilder<NestedContainersResponse.Builder, NestedContainersResponse> {
private static final SdkField<List<List<String>>> LIST_OF_LIST_OF_STRINGS_FIELD = SdkField
.<List<List<String>>> builder(MarshallingType.LIST)
.memberName("ListOfListOfStrings")
.getter(getter(NestedContainersResponse::listOfListOfStrings))
.setter(setter(Builder::listOfListOfStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ListOfListOfStrings").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<List<String>> builder(MarshallingType.LIST)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder()
.location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build())
.build()).build()).build()).build();
private static final SdkField<List<List<List<String>>>> LIST_OF_LIST_OF_LIST_OF_STRINGS_FIELD = SdkField
.<List<List<List<String>>>> builder(MarshallingType.LIST)
.memberName("ListOfListOfListOfStrings")
.getter(getter(NestedContainersResponse::listOfListOfListOfStrings))
.setter(setter(Builder::listOfListOfListOfStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ListOfListOfListOfStrings").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<List<List<String>>> builder(MarshallingType.LIST)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<List<String>> builder(MarshallingType.LIST)
.traits(LocationTrait.builder()
.location(MarshallLocation.PAYLOAD)
.locationName("member").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<String> builder(
MarshallingType.STRING)
.traits(LocationTrait
.builder()
.location(
MarshallLocation.PAYLOAD)
.locationName(
"member")
.build())
.build()).build())
.build()).build()).build()).build()).build();
private static final SdkField<Map<String, List<List<String>>>> MAP_OF_STRING_TO_LIST_OF_LIST_OF_STRINGS_FIELD = SdkField
.<Map<String, List<List<String>>>> builder(MarshallingType.MAP)
.memberName("MapOfStringToListOfListOfStrings")
.getter(getter(NestedContainersResponse::mapOfStringToListOfListOfStrings))
.setter(setter(Builder::mapOfStringToListOfListOfStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MapOfStringToListOfListOfStrings")
.build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<List<List<String>>> builder(MarshallingType.LIST)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<List<String>> builder(MarshallingType.LIST)
.traits(LocationTrait.builder()
.location(MarshallLocation.PAYLOAD)
.locationName("member").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<String> builder(
MarshallingType.STRING)
.traits(LocationTrait
.builder()
.location(
MarshallLocation.PAYLOAD)
.locationName(
"member")
.build())
.build()).build())
.build()).build()).build()).build()).build();
private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(LIST_OF_LIST_OF_STRINGS_FIELD,
LIST_OF_LIST_OF_LIST_OF_STRINGS_FIELD, MAP_OF_STRING_TO_LIST_OF_LIST_OF_STRINGS_FIELD));
private final List<List<String>> listOfListOfStrings;
private final List<List<List<String>>> listOfListOfListOfStrings;
private final Map<String, List<List<String>>> mapOfStringToListOfListOfStrings;
private NestedContainersResponse(BuilderImpl builder) {
super(builder);
this.listOfListOfStrings = builder.listOfListOfStrings;
this.listOfListOfListOfStrings = builder.listOfListOfListOfStrings;
this.mapOfStringToListOfListOfStrings = builder.mapOfStringToListOfListOfStrings;
}
/**
* For responses, this returns true if the service returned a value for the ListOfListOfStrings property. This DOES
* NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property).
* This is useful because the SDK will never return a null collection or map, but you may need to differentiate
* between the service returning nothing (or null) and the service returning an empty collection or map. For
* requests, this returns true if a value for the property was specified in the request builder, and false if a
* value was not specified.
*/
public final boolean hasListOfListOfStrings() {
return listOfListOfStrings != null && !(listOfListOfStrings instanceof SdkAutoConstructList);
}
/**
* Returns the value of the ListOfListOfStrings property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasListOfListOfStrings} method.
* </p>
*
* @return The value of the ListOfListOfStrings property for this object.
*/
public final List<List<String>> listOfListOfStrings() {
return listOfListOfStrings;
}
/**
* For responses, this returns true if the service returned a value for the ListOfListOfListOfStrings property. This
* DOES NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the
* property). This is useful because the SDK will never return a null collection or map, but you may need to
* differentiate between the service returning nothing (or null) and the service returning an empty collection or
* map. For requests, this returns true if a value for the property was specified in the request builder, and false
* if a value was not specified.
*/
public final boolean hasListOfListOfListOfStrings() {
return listOfListOfListOfStrings != null && !(listOfListOfListOfStrings instanceof SdkAutoConstructList);
}
/**
* Returns the value of the ListOfListOfListOfStrings property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasListOfListOfListOfStrings} method.
* </p>
*
* @return The value of the ListOfListOfListOfStrings property for this object.
*/
public final List<List<List<String>>> listOfListOfListOfStrings() {
return listOfListOfListOfStrings;
}
/**
* For responses, this returns true if the service returned a value for the MapOfStringToListOfListOfStrings
* property. This DOES NOT check that the value is non-empty (for which, you should check the {@code isEmpty()}
* method on the property). This is useful because the SDK will never return a null collection or map, but you may
* need to differentiate between the service returning nothing (or null) and the service returning an empty
* collection or map. For requests, this returns true if a value for the property was specified in the request
* builder, and false if a value was not specified.
*/
public final boolean hasMapOfStringToListOfListOfStrings() {
return mapOfStringToListOfListOfStrings != null && !(mapOfStringToListOfListOfStrings instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the MapOfStringToListOfListOfStrings property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasMapOfStringToListOfListOfStrings}
* method.
* </p>
*
* @return The value of the MapOfStringToListOfListOfStrings property for this object.
*/
public final Map<String, List<List<String>>> mapOfStringToListOfListOfStrings() {
return mapOfStringToListOfListOfStrings;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class<? extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
hashCode = 31 * hashCode + Objects.hashCode(hasListOfListOfStrings() ? listOfListOfStrings() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasListOfListOfListOfStrings() ? listOfListOfListOfStrings() : null);
hashCode = 31 * hashCode
+ Objects.hashCode(hasMapOfStringToListOfListOfStrings() ? mapOfStringToListOfListOfStrings() : null);
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof NestedContainersResponse)) {
return false;
}
NestedContainersResponse other = (NestedContainersResponse) obj;
return hasListOfListOfStrings() == other.hasListOfListOfStrings()
&& Objects.equals(listOfListOfStrings(), other.listOfListOfStrings())
&& hasListOfListOfListOfStrings() == other.hasListOfListOfListOfStrings()
&& Objects.equals(listOfListOfListOfStrings(), other.listOfListOfListOfStrings())
&& hasMapOfStringToListOfListOfStrings() == other.hasMapOfStringToListOfListOfStrings()
&& Objects.equals(mapOfStringToListOfListOfStrings(), other.mapOfStringToListOfListOfStrings());
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString
.builder("NestedContainersResponse")
.add("ListOfListOfStrings", hasListOfListOfStrings() ? listOfListOfStrings() : null)
.add("ListOfListOfListOfStrings", hasListOfListOfListOfStrings() ? listOfListOfListOfStrings() : null)
.add("MapOfStringToListOfListOfStrings",
hasMapOfStringToListOfListOfStrings() ? mapOfStringToListOfListOfStrings() : null).build();
}
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
switch (fieldName) {
case "ListOfListOfStrings":
return Optional.ofNullable(clazz.cast(listOfListOfStrings()));
case "ListOfListOfListOfStrings":
return Optional.ofNullable(clazz.cast(listOfListOfListOfStrings()));
case "MapOfStringToListOfListOfStrings":
return Optional.ofNullable(clazz.cast(mapOfStringToListOfListOfStrings()));
default:
return Optional.empty();
}
}
@Override
public final List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
private static <T> Function<Object, T> getter(Function<NestedContainersResponse, T> g) {
return obj -> g.apply((NestedContainersResponse) obj);
}
private static <T> BiConsumer<Object, T> setter(BiConsumer<Builder, T> s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
public interface Builder extends JsonProtocolTestsResponse.Builder, SdkPojo,
CopyableBuilder<Builder, NestedContainersResponse> {
/**
* Sets the value of the ListOfListOfStrings property for this object.
*
* @param listOfListOfStrings
* The new value for the ListOfListOfStrings property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfListOfStrings(Collection<? extends Collection<String>> listOfListOfStrings);
/**
* Sets the value of the ListOfListOfStrings property for this object.
*
* @param listOfListOfStrings
* The new value for the ListOfListOfStrings property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfListOfStrings(Collection<String>... listOfListOfStrings);
/**
* Sets the value of the ListOfListOfListOfStrings property for this object.
*
* @param listOfListOfListOfStrings
* The new value for the ListOfListOfListOfStrings property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfListOfListOfStrings(Collection<? extends Collection<? extends Collection<String>>> listOfListOfListOfStrings);
/**
* Sets the value of the ListOfListOfListOfStrings property for this object.
*
* @param listOfListOfListOfStrings
* The new value for the ListOfListOfListOfStrings property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfListOfListOfStrings(Collection<? extends Collection<String>>... listOfListOfListOfStrings);
/**
* Sets the value of the MapOfStringToListOfListOfStrings property for this object.
*
* @param mapOfStringToListOfListOfStrings
* The new value for the MapOfStringToListOfListOfStrings property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfStringToListOfListOfStrings(
Map<String, ? extends Collection<? extends Collection<String>>> mapOfStringToListOfListOfStrings);
}
static final class BuilderImpl extends JsonProtocolTestsResponse.BuilderImpl implements Builder {
private List<List<String>> listOfListOfStrings = DefaultSdkAutoConstructList.getInstance();
private List<List<List<String>>> listOfListOfListOfStrings = DefaultSdkAutoConstructList.getInstance();
private Map<String, List<List<String>>> mapOfStringToListOfListOfStrings = DefaultSdkAutoConstructMap.getInstance();
private BuilderImpl() {
}
private BuilderImpl(NestedContainersResponse model) {
super(model);
listOfListOfStrings(model.listOfListOfStrings);
listOfListOfListOfStrings(model.listOfListOfListOfStrings);
mapOfStringToListOfListOfStrings(model.mapOfStringToListOfListOfStrings);
}
public final Collection<? extends Collection<String>> getListOfListOfStrings() {
if (listOfListOfStrings instanceof SdkAutoConstructList) {
return null;
}
return listOfListOfStrings;
}
public final void setListOfListOfStrings(Collection<? extends Collection<String>> listOfListOfStrings) {
this.listOfListOfStrings = ListOfListOfStringsCopier.copy(listOfListOfStrings);
}
@Override
public final Builder listOfListOfStrings(Collection<? extends Collection<String>> listOfListOfStrings) {
this.listOfListOfStrings = ListOfListOfStringsCopier.copy(listOfListOfStrings);
return this;
}
@Override
@SafeVarargs
public final Builder listOfListOfStrings(Collection<String>... listOfListOfStrings) {
listOfListOfStrings(Arrays.asList(listOfListOfStrings));
return this;
}
public final Collection<? extends Collection<? extends Collection<String>>> getListOfListOfListOfStrings() {
if (listOfListOfListOfStrings instanceof SdkAutoConstructList) {
return null;
}
return listOfListOfListOfStrings;
}
public final void setListOfListOfListOfStrings(
Collection<? extends Collection<? extends Collection<String>>> listOfListOfListOfStrings) {
this.listOfListOfListOfStrings = ListOfListOfListOfStringsCopier.copy(listOfListOfListOfStrings);
}
@Override
public final Builder listOfListOfListOfStrings(
Collection<? extends Collection<? extends Collection<String>>> listOfListOfListOfStrings) {
this.listOfListOfListOfStrings = ListOfListOfListOfStringsCopier.copy(listOfListOfListOfStrings);
return this;
}
@Override
@SafeVarargs
public final Builder listOfListOfListOfStrings(Collection<? extends Collection<String>>... listOfListOfListOfStrings) {
listOfListOfListOfStrings(Arrays.asList(listOfListOfListOfStrings));
return this;
}
public final Map<String, ? extends Collection<? extends Collection<String>>> getMapOfStringToListOfListOfStrings() {
if (mapOfStringToListOfListOfStrings instanceof SdkAutoConstructMap) {
return null;
}
return mapOfStringToListOfListOfStrings;
}
public final void setMapOfStringToListOfListOfStrings(
Map<String, ? extends Collection<? extends Collection<String>>> mapOfStringToListOfListOfStrings) {
this.mapOfStringToListOfListOfStrings = MapOfStringToListOfListOfStringsCopier.copy(mapOfStringToListOfListOfStrings);
}
@Override
public final Builder mapOfStringToListOfListOfStrings(
Map<String, ? extends Collection<? extends Collection<String>>> mapOfStringToListOfListOfStrings) {
this.mapOfStringToListOfListOfStrings = MapOfStringToListOfListOfStringsCopier.copy(mapOfStringToListOfListOfStrings);
return this;
}
@Override
public NestedContainersResponse build() {
return new NestedContainersResponse(this);
}
@Override
public List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
}
}
| 3,412 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/mapofstringtointegerlistcopier.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import static java.util.stream.Collectors.toMap;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
@Generated("software.amazon.awssdk:codegen")
final class MapOfStringToIntegerListCopier {
static Map<String, List<Integer>> copy(Map<String, ? extends Collection<Integer>> mapOfStringToIntegerListParam) {
Map<String, List<Integer>> map;
if (mapOfStringToIntegerListParam == null || mapOfStringToIntegerListParam instanceof SdkAutoConstructMap) {
map = DefaultSdkAutoConstructMap.getInstance();
} else {
Map<String, List<Integer>> modifiableMap = new LinkedHashMap<>();
mapOfStringToIntegerListParam.forEach((key, value) -> {
List<Integer> list;
if (value == null || value instanceof SdkAutoConstructList) {
list = DefaultSdkAutoConstructList.getInstance();
} else {
List<Integer> modifiableList = new ArrayList<>();
value.forEach(entry -> {
modifiableList.add(entry);
});
list = Collections.unmodifiableList(modifiableList);
}
modifiableMap.put(key, list);
});
map = Collections.unmodifiableMap(modifiableMap);
}
return map;
}
}
| 3,413 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/recursivelisttypecopier.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import static java.util.stream.Collectors.toList;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
@Generated("software.amazon.awssdk:codegen")
final class RecursiveListTypeCopier {
static List<RecursiveStructType> copy(Collection<? extends RecursiveStructType> recursiveListTypeParam) {
List<RecursiveStructType> list;
if (recursiveListTypeParam == null || recursiveListTypeParam instanceof SdkAutoConstructList) {
list = DefaultSdkAutoConstructList.getInstance();
} else {
List<RecursiveStructType> modifiableList = new ArrayList<>();
recursiveListTypeParam.forEach(entry -> {
modifiableList.add(entry);
});
list = Collections.unmodifiableList(modifiableList);
}
return list;
}
static List<RecursiveStructType> copyFromBuilder(Collection<? extends RecursiveStructType.Builder> recursiveListTypeParam) {
List<RecursiveStructType> list;
if (recursiveListTypeParam == null || recursiveListTypeParam instanceof SdkAutoConstructList) {
list = DefaultSdkAutoConstructList.getInstance();
} else {
List<RecursiveStructType> modifiableList = new ArrayList<>();
recursiveListTypeParam.forEach(entry -> {
RecursiveStructType member = entry == null ? null : entry.build();
modifiableList.add(member);
});
list = Collections.unmodifiableList(modifiableList);
}
return list;
}
static List<RecursiveStructType.Builder> copyToBuilder(Collection<? extends RecursiveStructType> recursiveListTypeParam) {
List<RecursiveStructType.Builder> list;
if (recursiveListTypeParam == null || recursiveListTypeParam instanceof SdkAutoConstructList) {
list = DefaultSdkAutoConstructList.getInstance();
} else {
List<RecursiveStructType.Builder> modifiableList = new ArrayList<>();
recursiveListTypeParam.forEach(entry -> {
RecursiveStructType.Builder member = entry == null ? null : entry.toBuilder();
modifiableList.add(member);
});
list = Collections.unmodifiableList(modifiableList);
}
return list;
}
}
| 3,414 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/inputeventtwo.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import java.io.Serializable;
import java.nio.ByteBuffer;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
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.core.SdkBytes;
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.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public class InputEventTwo implements SdkPojo, Serializable, ToCopyableBuilder<InputEventTwo.Builder, InputEventTwo>,
InputEventStreamTwo {
private static final SdkField<SdkBytes> IMPLICIT_PAYLOAD_MEMBER_ONE_FIELD = SdkField
.<SdkBytes> builder(MarshallingType.SDK_BYTES).memberName("ImplicitPayloadMemberOne")
.getter(getter(InputEventTwo::implicitPayloadMemberOne)).setter(setter(Builder::implicitPayloadMemberOne))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ImplicitPayloadMemberOne").build())
.build();
private static final SdkField<String> IMPLICIT_PAYLOAD_MEMBER_TWO_FIELD = SdkField.<String> builder(MarshallingType.STRING)
.memberName("ImplicitPayloadMemberTwo").getter(getter(InputEventTwo::implicitPayloadMemberTwo))
.setter(setter(Builder::implicitPayloadMemberTwo))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ImplicitPayloadMemberTwo").build())
.build();
private static final SdkField<String> EVENT_HEADER_MEMBER_FIELD = SdkField.<String> builder(MarshallingType.STRING)
.memberName("EventHeaderMember").getter(getter(InputEventTwo::eventHeaderMember))
.setter(setter(Builder::eventHeaderMember))
.traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("EventHeaderMember").build()).build();
private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(
IMPLICIT_PAYLOAD_MEMBER_ONE_FIELD, IMPLICIT_PAYLOAD_MEMBER_TWO_FIELD, EVENT_HEADER_MEMBER_FIELD));
private static final long serialVersionUID = 1L;
private final SdkBytes implicitPayloadMemberOne;
private final String implicitPayloadMemberTwo;
private final String eventHeaderMember;
protected InputEventTwo(BuilderImpl builder) {
this.implicitPayloadMemberOne = builder.implicitPayloadMemberOne;
this.implicitPayloadMemberTwo = builder.implicitPayloadMemberTwo;
this.eventHeaderMember = builder.eventHeaderMember;
}
/**
* Returns the value of the ImplicitPayloadMemberOne property for this object.
*
* @return The value of the ImplicitPayloadMemberOne property for this object.
*/
public final SdkBytes implicitPayloadMemberOne() {
return implicitPayloadMemberOne;
}
/**
* Returns the value of the ImplicitPayloadMemberTwo property for this object.
*
* @return The value of the ImplicitPayloadMemberTwo property for this object.
*/
public final String implicitPayloadMemberTwo() {
return implicitPayloadMemberTwo;
}
/**
* Returns the value of the EventHeaderMember property for this object.
*
* @return The value of the EventHeaderMember property for this object.
*/
public final String eventHeaderMember() {
return eventHeaderMember;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class<? extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(implicitPayloadMemberOne());
hashCode = 31 * hashCode + Objects.hashCode(implicitPayloadMemberTwo());
hashCode = 31 * hashCode + Objects.hashCode(eventHeaderMember());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof InputEventTwo)) {
return false;
}
InputEventTwo other = (InputEventTwo) obj;
return Objects.equals(implicitPayloadMemberOne(), other.implicitPayloadMemberOne())
&& Objects.equals(implicitPayloadMemberTwo(), other.implicitPayloadMemberTwo())
&& Objects.equals(eventHeaderMember(), other.eventHeaderMember());
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("InputEventTwo").add("ImplicitPayloadMemberOne", implicitPayloadMemberOne())
.add("ImplicitPayloadMemberTwo", implicitPayloadMemberTwo()).add("EventHeaderMember", eventHeaderMember())
.build();
}
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
switch (fieldName) {
case "ImplicitPayloadMemberOne":
return Optional.ofNullable(clazz.cast(implicitPayloadMemberOne()));
case "ImplicitPayloadMemberTwo":
return Optional.ofNullable(clazz.cast(implicitPayloadMemberTwo()));
case "EventHeaderMember":
return Optional.ofNullable(clazz.cast(eventHeaderMember()));
default:
return Optional.empty();
}
}
@Override
public final InputEventTwo copy(Consumer<? super Builder> modifier) {
return ToCopyableBuilder.super.copy(modifier);
}
@Override
public final List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
private static <T> Function<Object, T> getter(Function<InputEventTwo, T> g) {
return obj -> g.apply((InputEventTwo) obj);
}
private static <T> BiConsumer<Object, T> setter(BiConsumer<Builder, T> s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
public interface Builder extends SdkPojo, CopyableBuilder<Builder, InputEventTwo> {
/**
* Sets the value of the ImplicitPayloadMemberOne property for this object.
*
* @param implicitPayloadMemberOne
* The new value for the ImplicitPayloadMemberOne property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder implicitPayloadMemberOne(SdkBytes implicitPayloadMemberOne);
/**
* Sets the value of the ImplicitPayloadMemberTwo property for this object.
*
* @param implicitPayloadMemberTwo
* The new value for the ImplicitPayloadMemberTwo property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder implicitPayloadMemberTwo(String implicitPayloadMemberTwo);
/**
* Sets the value of the EventHeaderMember property for this object.
*
* @param eventHeaderMember
* The new value for the EventHeaderMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder eventHeaderMember(String eventHeaderMember);
}
protected static class BuilderImpl implements Builder {
private SdkBytes implicitPayloadMemberOne;
private String implicitPayloadMemberTwo;
private String eventHeaderMember;
protected BuilderImpl() {
}
protected BuilderImpl(InputEventTwo model) {
implicitPayloadMemberOne(model.implicitPayloadMemberOne);
implicitPayloadMemberTwo(model.implicitPayloadMemberTwo);
eventHeaderMember(model.eventHeaderMember);
}
public final ByteBuffer getImplicitPayloadMemberOne() {
return implicitPayloadMemberOne == null ? null : implicitPayloadMemberOne.asByteBuffer();
}
public final void setImplicitPayloadMemberOne(ByteBuffer implicitPayloadMemberOne) {
implicitPayloadMemberOne(implicitPayloadMemberOne == null ? null : SdkBytes.fromByteBuffer(implicitPayloadMemberOne));
}
@Override
public final Builder implicitPayloadMemberOne(SdkBytes implicitPayloadMemberOne) {
this.implicitPayloadMemberOne = implicitPayloadMemberOne;
return this;
}
public final String getImplicitPayloadMemberTwo() {
return implicitPayloadMemberTwo;
}
public final void setImplicitPayloadMemberTwo(String implicitPayloadMemberTwo) {
this.implicitPayloadMemberTwo = implicitPayloadMemberTwo;
}
@Override
public final Builder implicitPayloadMemberTwo(String implicitPayloadMemberTwo) {
this.implicitPayloadMemberTwo = implicitPayloadMemberTwo;
return this;
}
public final String getEventHeaderMember() {
return eventHeaderMember;
}
public final void setEventHeaderMember(String eventHeaderMember) {
this.eventHeaderMember = eventHeaderMember;
}
@Override
public final Builder eventHeaderMember(String eventHeaderMember) {
this.eventHeaderMember = eventHeaderMember;
return this;
}
@Override
public InputEventTwo build() {
return new InputEventTwo(this);
}
@Override
public List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
}
}
| 3,415 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/listofblobstypecopier.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import static java.util.stream.Collectors.toList;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkBytes;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
@Generated("software.amazon.awssdk:codegen")
final class ListOfBlobsTypeCopier {
static List<SdkBytes> copy(Collection<SdkBytes> listOfBlobsTypeParam) {
List<SdkBytes> list;
if (listOfBlobsTypeParam == null || listOfBlobsTypeParam instanceof SdkAutoConstructList) {
list = DefaultSdkAutoConstructList.getInstance();
} else {
List<SdkBytes> modifiableList = new ArrayList<>();
listOfBlobsTypeParam.forEach(entry -> {
modifiableList.add(entry);
});
list = Collections.unmodifiableList(modifiableList);
}
return list;
}
}
| 3,416 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/mapofstringtostringcopier.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import static java.util.stream.Collectors.toMap;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.Map;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
@Generated("software.amazon.awssdk:codegen")
final class MapOfStringToStringCopier {
static Map<String, String> copy(Map<String, String> mapOfStringToStringParam) {
Map<String, String> map;
if (mapOfStringToStringParam == null || mapOfStringToStringParam instanceof SdkAutoConstructMap) {
map = DefaultSdkAutoConstructMap.getInstance();
} else {
Map<String, String> modifiableMap = new LinkedHashMap<>();
mapOfStringToStringParam.forEach((key, value) -> {
modifiableMap.put(key, value);
});
map = Collections.unmodifiableMap(modifiableMap);
}
return map;
}
}
| 3,417 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/documentinputoperationrequest.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
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.AwsRequestOverrideConfiguration;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.document.Document;
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.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class DocumentInputOperationRequest extends JsonProtocolTestsRequest implements
ToCopyableBuilder<DocumentInputOperationRequest.Builder, DocumentInputOperationRequest> {
private static final SdkField<Document> DOCUMENT_MEMBER_FIELD = SdkField
.<Document> builder(MarshallingType.DOCUMENT)
.memberName("DocumentMember")
.getter(getter(DocumentInputOperationRequest::documentMember))
.setter(setter(Builder::documentMember))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DocumentMember").build(),
PayloadTrait.create()).build();
private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(DOCUMENT_MEMBER_FIELD));
private final Document documentMember;
private DocumentInputOperationRequest(BuilderImpl builder) {
super(builder);
this.documentMember = builder.documentMember;
}
/**
* Returns the value of the DocumentMember property for this object.
*
* @return The value of the DocumentMember property for this object.
*/
public final Document documentMember() {
return documentMember;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class<? extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
hashCode = 31 * hashCode + Objects.hashCode(documentMember());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof DocumentInputOperationRequest)) {
return false;
}
DocumentInputOperationRequest other = (DocumentInputOperationRequest) obj;
return Objects.equals(documentMember(), other.documentMember());
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("DocumentInputOperationRequest").add("DocumentMember", documentMember()).build();
}
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
switch (fieldName) {
case "DocumentMember":
return Optional.ofNullable(clazz.cast(documentMember()));
default:
return Optional.empty();
}
}
@Override
public final List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
private static <T> Function<Object, T> getter(Function<DocumentInputOperationRequest, T> g) {
return obj -> g.apply((DocumentInputOperationRequest) obj);
}
private static <T> BiConsumer<Object, T> setter(BiConsumer<Builder, T> s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
public interface Builder extends JsonProtocolTestsRequest.Builder, SdkPojo,
CopyableBuilder<Builder, DocumentInputOperationRequest> {
/**
* Sets the value of the DocumentMember property for this object.
*
* @param documentMember
* The new value for the DocumentMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder documentMember(Document documentMember);
@Override
Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration);
@Override
Builder overrideConfiguration(Consumer<AwsRequestOverrideConfiguration.Builder> builderConsumer);
}
static final class BuilderImpl extends JsonProtocolTestsRequest.BuilderImpl implements Builder {
private Document documentMember;
private BuilderImpl() {
}
private BuilderImpl(DocumentInputOperationRequest model) {
super(model);
documentMember(model.documentMember);
}
public final Document getDocumentMember() {
return documentMember;
}
@Override
public final Builder documentMember(Document documentMember) {
this.documentMember = documentMember;
return this;
}
public final void setDocumentMember(Document documentMember) {
this.documentMember = documentMember;
}
@Override
public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) {
super.overrideConfiguration(overrideConfiguration);
return this;
}
@Override
public Builder overrideConfiguration(Consumer<AwsRequestOverrideConfiguration.Builder> builderConsumer) {
super.overrideConfiguration(builderConsumer);
return this;
}
@Override
public DocumentInputOperationRequest build() {
return new DocumentInputOperationRequest(this);
}
@Override
public List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
}
} | 3,418 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/eventone.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
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.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.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public class EventOne implements SdkPojo, Serializable, ToCopyableBuilder<EventOne.Builder, EventOne>, EventStream {
private static final SdkField<String> FOO_FIELD = SdkField.<String> builder(MarshallingType.STRING).memberName("Foo")
.getter(getter(EventOne::foo)).setter(setter(Builder::foo))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Foo").build()).build();
private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(FOO_FIELD));
private static final long serialVersionUID = 1L;
private final String foo;
protected EventOne(BuilderImpl builder) {
this.foo = builder.foo;
}
/**
* Returns the value of the Foo property for this object.
*
* @return The value of the Foo property for this object.
*/
public final String foo() {
return foo;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class<? extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(foo());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof EventOne)) {
return false;
}
EventOne other = (EventOne) obj;
return Objects.equals(foo(), other.foo());
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("EventOne").add("Foo", foo()).build();
}
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
switch (fieldName) {
case "Foo":
return Optional.ofNullable(clazz.cast(foo()));
default:
return Optional.empty();
}
}
@Override
public final EventOne copy(Consumer<? super Builder> modifier) {
return ToCopyableBuilder.super.copy(modifier);
}
@Override
public final List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
private static <T> Function<Object, T> getter(Function<EventOne, T> g) {
return obj -> g.apply((EventOne) obj);
}
private static <T> BiConsumer<Object, T> setter(BiConsumer<Builder, T> s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
/**
* Calls the appropriate visit method depending on the subtype of {@link EventOne}.
*
* @param visitor
* Visitor to invoke.
*/
@Override
public void accept(EventStreamOperationResponseHandler.Visitor visitor) {
throw new UnsupportedOperationException();
}
public interface Builder extends SdkPojo, CopyableBuilder<Builder, EventOne> {
/**
* Sets the value of the Foo property for this object.
*
* @param foo
* The new value for the Foo property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder foo(String foo);
}
protected static class BuilderImpl implements Builder {
private String foo;
protected BuilderImpl() {
}
protected BuilderImpl(EventOne model) {
foo(model.foo);
}
public final String getFoo() {
return foo;
}
public final void setFoo(String foo) {
this.foo = foo;
}
@Override
public final Builder foo(String foo) {
this.foo = foo;
return this;
}
@Override
public EventOne build() {
return new EventOne(this);
}
@Override
public List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
}
}
| 3,419 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/inputeventstream.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import java.util.EnumSet;
import java.util.Map;
import java.util.Set;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.annotations.SdkPublicApi;
import software.amazon.awssdk.services.jsonprotocoltests.model.inputeventstream.DefaultInputEvent;
import software.amazon.awssdk.utils.internal.EnumUtils;
/**
* Base interface for all event types in InputEventStream.
*/
@Generated("software.amazon.awssdk:codegen")
@SdkPublicApi
public interface InputEventStream {
/**
* Create a builder for the {@code InputEvent} event type for this stream.
*/
static InputEvent.Builder inputEventBuilder() {
return DefaultInputEvent.builder();
}
/**
* The type of this event. Corresponds to the {@code :event-type} header on the Message.
*/
default EventType sdkEventType() {
return EventType.UNKNOWN_TO_SDK_VERSION;
}
/**
* The known possible types of events for {@code InputEventStream}.
*/
@Generated("software.amazon.awssdk:codegen")
enum EventType {
INPUT_EVENT("InputEvent"),
UNKNOWN_TO_SDK_VERSION(null);
private static final Map<String, EventType> VALUE_MAP = EnumUtils.uniqueIndex(EventType.class, EventType::toString);
private final String value;
private EventType(String value) {
this.value = value;
}
@Override
public String toString() {
return String.valueOf(value);
}
/**
* Use this in place of valueOf to convert the raw string returned by the service into the enum value.
*
* @param value
* real value
* @return EventType corresponding to the value
*/
public static EventType fromValue(String value) {
if (value == null) {
return null;
}
return VALUE_MAP.getOrDefault(value, UNKNOWN_TO_SDK_VERSION);
}
/**
* Use this in place of {@link #values()} to return a {@link Set} of all values known to the SDK. This will
* return all known enum values except {@link #UNKNOWN_TO_SDK_VERSION}.
*
* @return a {@link Set} of known {@link EventType}s
*/
public static Set<EventType> knownValues() {
Set<EventType> knownValues = EnumSet.allOf(EventType.class);
knownValues.remove(UNKNOWN_TO_SDK_VERSION);
return knownValues;
}
}
}
| 3,420 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/mapofenumtostringcopier.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import static java.util.stream.Collectors.toMap;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.Map;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
@Generated("software.amazon.awssdk:codegen")
final class MapOfEnumToStringCopier {
static Map<String, String> copy(Map<String, String> mapOfEnumToStringParam) {
Map<String, String> map;
if (mapOfEnumToStringParam == null || mapOfEnumToStringParam instanceof SdkAutoConstructMap) {
map = DefaultSdkAutoConstructMap.getInstance();
} else {
Map<String, String> modifiableMap = new LinkedHashMap<>();
mapOfEnumToStringParam.forEach((key, value) -> {
modifiableMap.put(key, value);
});
map = Collections.unmodifiableMap(modifiableMap);
}
return map;
}
static Map<String, String> copyEnumToString(Map<EnumType, String> mapOfEnumToStringParam) {
Map<String, String> map;
if (mapOfEnumToStringParam == null || mapOfEnumToStringParam instanceof SdkAutoConstructMap) {
map = DefaultSdkAutoConstructMap.getInstance();
} else {
Map<String, String> modifiableMap = new LinkedHashMap<>();
mapOfEnumToStringParam.forEach((key, value) -> {
String result = key.toString();
modifiableMap.put(result, value);
});
map = Collections.unmodifiableMap(modifiableMap);
}
return map;
}
static Map<EnumType, String> copyStringToEnum(Map<String, String> mapOfEnumToStringParam) {
Map<EnumType, String> map;
if (mapOfEnumToStringParam == null || mapOfEnumToStringParam instanceof SdkAutoConstructMap) {
map = DefaultSdkAutoConstructMap.getInstance();
} else {
Map<EnumType, String> modifiableMap = new LinkedHashMap<>();
mapOfEnumToStringParam.forEach((key, value) -> {
EnumType result = EnumType.fromValue(key);
if (result != EnumType.UNKNOWN_TO_SDK_VERSION) {
modifiableMap.put(result, value);
}
});
map = Collections.unmodifiableMap(modifiableMap);
}
return map;
}
}
| 3,421 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/subtypeone.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
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.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class SubTypeOne implements SdkPojo, Serializable, ToCopyableBuilder<SubTypeOne.Builder, SubTypeOne> {
private static final SdkField<String> SUB_TYPE_ONE_MEMBER_FIELD = SdkField.<String> builder(MarshallingType.STRING)
.memberName("SubTypeOneMember").getter(getter(SubTypeOne::subTypeOneMember))
.setter(setter(Builder::subTypeOneMember))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SubTypeOneMember").build()).build();
private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(SUB_TYPE_ONE_MEMBER_FIELD));
private static final long serialVersionUID = 1L;
private final String subTypeOneMember;
private SubTypeOne(BuilderImpl builder) {
this.subTypeOneMember = builder.subTypeOneMember;
}
/**
* Returns the value of the SubTypeOneMember property for this object.
*
* @return The value of the SubTypeOneMember property for this object.
*/
public final String subTypeOneMember() {
return subTypeOneMember;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class<? extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(subTypeOneMember());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof SubTypeOne)) {
return false;
}
SubTypeOne other = (SubTypeOne) obj;
return Objects.equals(subTypeOneMember(), other.subTypeOneMember());
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("SubTypeOne").add("SubTypeOneMember", subTypeOneMember()).build();
}
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
switch (fieldName) {
case "SubTypeOneMember":
return Optional.ofNullable(clazz.cast(subTypeOneMember()));
default:
return Optional.empty();
}
}
@Override
public final List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
private static <T> Function<Object, T> getter(Function<SubTypeOne, T> g) {
return obj -> g.apply((SubTypeOne) obj);
}
private static <T> BiConsumer<Object, T> setter(BiConsumer<Builder, T> s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
public interface Builder extends SdkPojo, CopyableBuilder<Builder, SubTypeOne> {
/**
* Sets the value of the SubTypeOneMember property for this object.
*
* @param subTypeOneMember
* The new value for the SubTypeOneMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder subTypeOneMember(String subTypeOneMember);
}
static final class BuilderImpl implements Builder {
private String subTypeOneMember;
private BuilderImpl() {
}
private BuilderImpl(SubTypeOne model) {
subTypeOneMember(model.subTypeOneMember);
}
public final String getSubTypeOneMember() {
return subTypeOneMember;
}
public final void setSubTypeOneMember(String subTypeOneMember) {
this.subTypeOneMember = subTypeOneMember;
}
@Override
public final Builder subTypeOneMember(String subTypeOneMember) {
this.subTypeOneMember = subTypeOneMember;
return this;
}
@Override
public SubTypeOne build() {
return new SubTypeOne(this);
}
@Override
public List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
}
}
| 3,422 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/mapofstringtolistoflistofstringscopier.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import static java.util.stream.Collectors.toMap;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
@Generated("software.amazon.awssdk:codegen")
final class MapOfStringToListOfListOfStringsCopier {
static Map<String, List<List<String>>> copy(
Map<String, ? extends Collection<? extends Collection<String>>> mapOfStringToListOfListOfStringsParam) {
Map<String, List<List<String>>> map;
if (mapOfStringToListOfListOfStringsParam == null || mapOfStringToListOfListOfStringsParam instanceof SdkAutoConstructMap) {
map = DefaultSdkAutoConstructMap.getInstance();
} else {
Map<String, List<List<String>>> modifiableMap = new LinkedHashMap<>();
mapOfStringToListOfListOfStringsParam.forEach((key, value) -> {
List<List<String>> list;
if (value == null || value instanceof SdkAutoConstructList) {
list = DefaultSdkAutoConstructList.getInstance();
} else {
List<List<String>> modifiableList = new ArrayList<>();
value.forEach(entry -> {
List<String> list1;
if (entry == null || entry instanceof SdkAutoConstructList) {
list1 = DefaultSdkAutoConstructList.getInstance();
} else {
List<String> modifiableList1 = new ArrayList<>();
entry.forEach(entry1 -> {
modifiableList1.add(entry1);
});
list1 = Collections.unmodifiableList(modifiableList1);
}
modifiableList.add(list1);
});
list = Collections.unmodifiableList(modifiableList);
}
modifiableMap.put(key, list);
});
map = Collections.unmodifiableMap(modifiableMap);
}
return map;
}
}
| 3,423 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/operationwithdeprecatedmemberrequest.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
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.AwsRequestOverrideConfiguration;
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.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class OperationWithDeprecatedMemberRequest extends JsonProtocolTestsRequest implements
ToCopyableBuilder<OperationWithDeprecatedMemberRequest.Builder, OperationWithDeprecatedMemberRequest> {
private static final SdkField<String> MEMBER_MODELED_AS_DEPRECATED_FIELD = SdkField.<String> builder(MarshallingType.STRING)
.memberName("MemberModeledAsDeprecated")
.getter(getter(OperationWithDeprecatedMemberRequest::memberModeledAsDeprecated))
.setter(setter(Builder::memberModeledAsDeprecated))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MemberModeledAsDeprecated").build())
.build();
private static final SdkField<String> MEMBER_MODIFIED_AS_DEPRECATED_FIELD = SdkField
.<String> builder(MarshallingType.STRING)
.memberName("MemberModifiedAsDeprecated")
.getter(getter(OperationWithDeprecatedMemberRequest::memberModifiedAsDeprecated))
.setter(setter(Builder::memberModifiedAsDeprecated))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MemberModifiedAsDeprecated").build())
.build();
private static final SdkField<String> UNDEPRECATED_MEMBER_FIELD = SdkField.<String> builder(MarshallingType.STRING)
.memberName("UndeprecatedMember").getter(getter(OperationWithDeprecatedMemberRequest::undeprecatedMember))
.setter(setter(Builder::undeprecatedMember))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("UndeprecatedMember").build())
.build();
private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(
MEMBER_MODELED_AS_DEPRECATED_FIELD, MEMBER_MODIFIED_AS_DEPRECATED_FIELD, UNDEPRECATED_MEMBER_FIELD));
private final String memberModeledAsDeprecated;
private final String memberModifiedAsDeprecated;
private final String undeprecatedMember;
private OperationWithDeprecatedMemberRequest(BuilderImpl builder) {
super(builder);
this.memberModeledAsDeprecated = builder.memberModeledAsDeprecated;
this.memberModifiedAsDeprecated = builder.memberModifiedAsDeprecated;
this.undeprecatedMember = builder.undeprecatedMember;
}
/**
* Returns the value of the MemberModeledAsDeprecated property for this object.
*
* @return The value of the MemberModeledAsDeprecated property for this object.
* @deprecated This field is modeled as deprecated.
*/
@Deprecated
public final String memberModeledAsDeprecated() {
return memberModeledAsDeprecated;
}
/**
* Returns the value of the MemberModifiedAsDeprecated property for this object.
*
* @return The value of the MemberModifiedAsDeprecated property for this object.
* @deprecated This field is modified as deprecated.
*/
@Deprecated
public final String memberModifiedAsDeprecated() {
return memberModifiedAsDeprecated;
}
/**
* Returns the value of the UndeprecatedMember property for this object.
*
* @return The value of the UndeprecatedMember property for this object.
*/
public final String undeprecatedMember() {
return undeprecatedMember;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class<? extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
hashCode = 31 * hashCode + Objects.hashCode(memberModeledAsDeprecated());
hashCode = 31 * hashCode + Objects.hashCode(memberModifiedAsDeprecated());
hashCode = 31 * hashCode + Objects.hashCode(undeprecatedMember());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof OperationWithDeprecatedMemberRequest)) {
return false;
}
OperationWithDeprecatedMemberRequest other = (OperationWithDeprecatedMemberRequest) obj;
return Objects.equals(memberModeledAsDeprecated(), other.memberModeledAsDeprecated())
&& Objects.equals(memberModifiedAsDeprecated(), other.memberModifiedAsDeprecated())
&& Objects.equals(undeprecatedMember(), other.undeprecatedMember());
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("OperationWithDeprecatedMemberRequest")
.add("MemberModeledAsDeprecated", memberModeledAsDeprecated())
.add("MemberModifiedAsDeprecated", memberModifiedAsDeprecated()).add("UndeprecatedMember", undeprecatedMember())
.build();
}
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
switch (fieldName) {
case "MemberModeledAsDeprecated":
return Optional.ofNullable(clazz.cast(memberModeledAsDeprecated()));
case "MemberModifiedAsDeprecated":
return Optional.ofNullable(clazz.cast(memberModifiedAsDeprecated()));
case "UndeprecatedMember":
return Optional.ofNullable(clazz.cast(undeprecatedMember()));
default:
return Optional.empty();
}
}
@Override
public final List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
private static <T> Function<Object, T> getter(Function<OperationWithDeprecatedMemberRequest, T> g) {
return obj -> g.apply((OperationWithDeprecatedMemberRequest) obj);
}
private static <T> BiConsumer<Object, T> setter(BiConsumer<Builder, T> s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
public interface Builder extends JsonProtocolTestsRequest.Builder, SdkPojo,
CopyableBuilder<Builder, OperationWithDeprecatedMemberRequest> {
/**
* Sets the value of the MemberModeledAsDeprecated property for this object.
*
* @param memberModeledAsDeprecated
* The new value for the MemberModeledAsDeprecated property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
* @deprecated This field is modeled as deprecated.
*/
@Deprecated
Builder memberModeledAsDeprecated(String memberModeledAsDeprecated);
/**
* Sets the value of the MemberModifiedAsDeprecated property for this object.
*
* @param memberModifiedAsDeprecated
* The new value for the MemberModifiedAsDeprecated property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
* @deprecated This field is modified as deprecated.
*/
@Deprecated
Builder memberModifiedAsDeprecated(String memberModifiedAsDeprecated);
/**
* Sets the value of the UndeprecatedMember property for this object.
*
* @param undeprecatedMember
* The new value for the UndeprecatedMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder undeprecatedMember(String undeprecatedMember);
@Override
Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration);
@Override
Builder overrideConfiguration(Consumer<AwsRequestOverrideConfiguration.Builder> builderConsumer);
}
static final class BuilderImpl extends JsonProtocolTestsRequest.BuilderImpl implements Builder {
private String memberModeledAsDeprecated;
private String memberModifiedAsDeprecated;
private String undeprecatedMember;
private BuilderImpl() {
}
private BuilderImpl(OperationWithDeprecatedMemberRequest model) {
super(model);
memberModeledAsDeprecated(model.memberModeledAsDeprecated);
memberModifiedAsDeprecated(model.memberModifiedAsDeprecated);
undeprecatedMember(model.undeprecatedMember);
}
@Deprecated
public final String getMemberModeledAsDeprecated() {
return memberModeledAsDeprecated;
}
@Deprecated
public final void setMemberModeledAsDeprecated(String memberModeledAsDeprecated) {
this.memberModeledAsDeprecated = memberModeledAsDeprecated;
}
@Override
@Deprecated
public final Builder memberModeledAsDeprecated(String memberModeledAsDeprecated) {
this.memberModeledAsDeprecated = memberModeledAsDeprecated;
return this;
}
@Deprecated
public final String getMemberModifiedAsDeprecated() {
return memberModifiedAsDeprecated;
}
@Deprecated
public final void setMemberModifiedAsDeprecated(String memberModifiedAsDeprecated) {
this.memberModifiedAsDeprecated = memberModifiedAsDeprecated;
}
@Override
@Deprecated
public final Builder memberModifiedAsDeprecated(String memberModifiedAsDeprecated) {
this.memberModifiedAsDeprecated = memberModifiedAsDeprecated;
return this;
}
public final String getUndeprecatedMember() {
return undeprecatedMember;
}
public final void setUndeprecatedMember(String undeprecatedMember) {
this.undeprecatedMember = undeprecatedMember;
}
@Override
public final Builder undeprecatedMember(String undeprecatedMember) {
this.undeprecatedMember = undeprecatedMember;
return this;
}
@Override
public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) {
super.overrideConfiguration(overrideConfiguration);
return this;
}
@Override
public Builder overrideConfiguration(Consumer<AwsRequestOverrideConfiguration.Builder> builderConsumer) {
super.overrideConfiguration(builderConsumer);
return this;
}
@Override
public OperationWithDeprecatedMemberRequest build() {
return new OperationWithDeprecatedMemberRequest(this);
}
@Override
public List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
}
}
| 3,424 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/mapofstringtoenumcopier.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import static java.util.stream.Collectors.toMap;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.Map;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
@Generated("software.amazon.awssdk:codegen")
final class MapOfStringToEnumCopier {
static Map<String, String> copy(Map<String, String> mapOfStringToEnumParam) {
Map<String, String> map;
if (mapOfStringToEnumParam == null || mapOfStringToEnumParam instanceof SdkAutoConstructMap) {
map = DefaultSdkAutoConstructMap.getInstance();
} else {
Map<String, String> modifiableMap = new LinkedHashMap<>();
mapOfStringToEnumParam.forEach((key, value) -> {
modifiableMap.put(key, value);
});
map = Collections.unmodifiableMap(modifiableMap);
}
return map;
}
static Map<String, String> copyEnumToString(Map<String, EnumType> mapOfStringToEnumParam) {
Map<String, String> map;
if (mapOfStringToEnumParam == null || mapOfStringToEnumParam instanceof SdkAutoConstructMap) {
map = DefaultSdkAutoConstructMap.getInstance();
} else {
Map<String, String> modifiableMap = new LinkedHashMap<>();
mapOfStringToEnumParam.forEach((key, value) -> {
String result = value.toString();
modifiableMap.put(key, result);
});
map = Collections.unmodifiableMap(modifiableMap);
}
return map;
}
static Map<String, EnumType> copyStringToEnum(Map<String, String> mapOfStringToEnumParam) {
Map<String, EnumType> map;
if (mapOfStringToEnumParam == null || mapOfStringToEnumParam instanceof SdkAutoConstructMap) {
map = DefaultSdkAutoConstructMap.getInstance();
} else {
Map<String, EnumType> modifiableMap = new LinkedHashMap<>();
mapOfStringToEnumParam.forEach((key, value) -> {
EnumType result = EnumType.fromValue(value);
modifiableMap.put(key, result);
});
map = Collections.unmodifiableMap(modifiableMap);
}
return map;
}
}
| 3,425 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/jsonprotocoltestsrequest.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.awscore.AwsRequest;
@Generated("software.amazon.awssdk:codegen")
public abstract class JsonProtocolTestsRequest extends AwsRequest {
protected JsonProtocolTestsRequest(Builder builder) {
super(builder);
}
@Override
public abstract Builder toBuilder();
public interface Builder extends AwsRequest.Builder {
@Override
JsonProtocolTestsRequest build();
}
protected abstract static class BuilderImpl extends AwsRequest.BuilderImpl implements Builder {
protected BuilderImpl() {
}
protected BuilderImpl(JsonProtocolTestsRequest request) {
super(request);
}
}
}
| 3,426 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/eventstreamoperationresponse.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class EventStreamOperationResponse extends JsonProtocolTestsResponse implements
ToCopyableBuilder<EventStreamOperationResponse.Builder, EventStreamOperationResponse> {
private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList());
private EventStreamOperationResponse(BuilderImpl builder) {
super(builder);
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class<? extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof EventStreamOperationResponse)) {
return false;
}
return true;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("EventStreamOperationResponse").build();
}
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
return Optional.empty();
}
@Override
public final List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
public interface Builder extends JsonProtocolTestsResponse.Builder, SdkPojo,
CopyableBuilder<Builder, EventStreamOperationResponse> {
}
static final class BuilderImpl extends JsonProtocolTestsResponse.BuilderImpl implements Builder {
private BuilderImpl() {
}
private BuilderImpl(EventStreamOperationResponse model) {
super(model);
}
@Override
public EventStreamOperationResponse build() {
return new EventStreamOperationResponse(this);
}
@Override
public List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
}
}
| 3,427 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/nestedqueryparameteroperation.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
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.RequiredTrait;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class NestedQueryParameterOperation implements SdkPojo, Serializable,
ToCopyableBuilder<NestedQueryParameterOperation.Builder, NestedQueryParameterOperation> {
private static final SdkField<String> QUERY_PARAM_ONE_FIELD = SdkField
.<String> builder(MarshallingType.STRING)
.memberName("QueryParamOne")
.getter(getter(NestedQueryParameterOperation::queryParamOne))
.setter(setter(Builder::queryParamOne))
.traits(LocationTrait.builder().location(MarshallLocation.QUERY_PARAM).locationName("QueryParamOne").build(),
RequiredTrait.create()).build();
private static final SdkField<String> QUERY_PARAM_TWO_FIELD = SdkField
.<String> builder(MarshallingType.STRING)
.memberName("QueryParamTwo").getter(getter(NestedQueryParameterOperation::queryParamTwo))
.setter(setter(Builder::queryParamTwo))
.traits(LocationTrait.builder().location(MarshallLocation.QUERY_PARAM).locationName("QueryParamTwo").build()).build();
private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(QUERY_PARAM_ONE_FIELD,
QUERY_PARAM_TWO_FIELD));
private static final long serialVersionUID = 1L;
private final String queryParamOne;
private final String queryParamTwo;
private NestedQueryParameterOperation(BuilderImpl builder) {
this.queryParamOne = builder.queryParamOne;
this.queryParamTwo = builder.queryParamTwo;
}
/**
* Returns the value of the QueryParamOne property for this object.
*
* @return The value of the QueryParamOne property for this object.
*/
public final String queryParamOne() {
return queryParamOne;
}
/**
* Returns the value of the QueryParamTwo property for this object.
*
* @return The value of the QueryParamTwo property for this object.
*/
public final String queryParamTwo() {
return queryParamTwo;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class<? extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(queryParamOne());
hashCode = 31 * hashCode + Objects.hashCode(queryParamTwo());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof NestedQueryParameterOperation)) {
return false;
}
NestedQueryParameterOperation other = (NestedQueryParameterOperation) obj;
return Objects.equals(queryParamOne(), other.queryParamOne()) && Objects.equals(queryParamTwo(), other.queryParamTwo());
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("NestedQueryParameterOperation").add("QueryParamOne", queryParamOne())
.add("QueryParamTwo", queryParamTwo()).build();
}
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
switch (fieldName) {
case "QueryParamOne":
return Optional.ofNullable(clazz.cast(queryParamOne()));
case "QueryParamTwo":
return Optional.ofNullable(clazz.cast(queryParamTwo()));
default:
return Optional.empty();
}
}
@Override
public final List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
private static <T> Function<Object, T> getter(Function<NestedQueryParameterOperation, T> g) {
return obj -> g.apply((NestedQueryParameterOperation) obj);
}
private static <T> BiConsumer<Object, T> setter(BiConsumer<Builder, T> s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
public interface Builder extends SdkPojo, CopyableBuilder<Builder, NestedQueryParameterOperation> {
/**
* Sets the value of the QueryParamOne property for this object.
*
* @param queryParamOne
* The new value for the QueryParamOne property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder queryParamOne(String queryParamOne);
/**
* Sets the value of the QueryParamTwo property for this object.
*
* @param queryParamTwo
* The new value for the QueryParamTwo property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder queryParamTwo(String queryParamTwo);
}
static final class BuilderImpl implements Builder {
private String queryParamOne;
private String queryParamTwo;
private BuilderImpl() {
}
private BuilderImpl(NestedQueryParameterOperation model) {
queryParamOne(model.queryParamOne);
queryParamTwo(model.queryParamTwo);
}
public final String getQueryParamOne() {
return queryParamOne;
}
public final void setQueryParamOne(String queryParamOne) {
this.queryParamOne = queryParamOne;
}
@Override
public final Builder queryParamOne(String queryParamOne) {
this.queryParamOne = queryParamOne;
return this;
}
public final String getQueryParamTwo() {
return queryParamTwo;
}
public final void setQueryParamTwo(String queryParamTwo) {
this.queryParamTwo = queryParamTwo;
}
@Override
public final Builder queryParamTwo(String queryParamTwo) {
this.queryParamTwo = queryParamTwo;
return this;
}
@Override
public NestedQueryParameterOperation build() {
return new NestedQueryParameterOperation(this);
}
@Override
public List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
}
}
| 3,428 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/blobmaptypecopier.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import static java.util.stream.Collectors.toMap;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.Map;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkBytes;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
@Generated("software.amazon.awssdk:codegen")
final class BlobMapTypeCopier {
static Map<String, SdkBytes> copy(Map<String, SdkBytes> blobMapTypeParam) {
Map<String, SdkBytes> map;
if (blobMapTypeParam == null || blobMapTypeParam instanceof SdkAutoConstructMap) {
map = DefaultSdkAutoConstructMap.getInstance();
} else {
Map<String, SdkBytes> modifiableMap = new LinkedHashMap<>();
blobMapTypeParam.forEach((key, value) -> {
modifiableMap.put(key, value);
});
map = Collections.unmodifiableMap(modifiableMap);
}
return map;
}
}
| 3,429 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/queryparameteroperationresponse.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
@Generated("software.amazon.awssdk:codegen")
public final class QueryParameterOperationResponse extends JsonProtocolTestsResponse implements
ToCopyableBuilder<QueryParameterOperationResponse.Builder, QueryParameterOperationResponse> {
private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList());
private QueryParameterOperationResponse(BuilderImpl builder) {
super(builder);
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class<? extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof QueryParameterOperationResponse)) {
return false;
}
return true;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("QueryParameterOperationResponse").build();
}
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
return Optional.empty();
}
@Override
public final List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
public interface Builder extends JsonProtocolTestsResponse.Builder, SdkPojo,
CopyableBuilder<Builder, QueryParameterOperationResponse> {
}
static final class BuilderImpl extends JsonProtocolTestsResponse.BuilderImpl implements Builder {
private BuilderImpl() {
}
private BuilderImpl(QueryParameterOperationResponse model) {
super(model);
}
@Override
public QueryParameterOperationResponse build() {
return new QueryParameterOperationResponse(this);
}
@Override
public List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
}
}
| 3,430 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/structwithnestedblobtype.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import java.io.Serializable;
import java.nio.ByteBuffer;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkBytes;
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.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class StructWithNestedBlobType implements SdkPojo, Serializable,
ToCopyableBuilder<StructWithNestedBlobType.Builder, StructWithNestedBlobType> {
private static final SdkField<SdkBytes> NESTED_BLOB_FIELD = SdkField.<SdkBytes> builder(MarshallingType.SDK_BYTES)
.memberName("NestedBlob").getter(getter(StructWithNestedBlobType::nestedBlob)).setter(setter(Builder::nestedBlob))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("NestedBlob").build()).build();
private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(NESTED_BLOB_FIELD));
private static final long serialVersionUID = 1L;
private final SdkBytes nestedBlob;
private StructWithNestedBlobType(BuilderImpl builder) {
this.nestedBlob = builder.nestedBlob;
}
/**
* Returns the value of the NestedBlob property for this object.
*
* @return The value of the NestedBlob property for this object.
*/
public final SdkBytes nestedBlob() {
return nestedBlob;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class<? extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(nestedBlob());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof StructWithNestedBlobType)) {
return false;
}
StructWithNestedBlobType other = (StructWithNestedBlobType) obj;
return Objects.equals(nestedBlob(), other.nestedBlob());
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("StructWithNestedBlobType").add("NestedBlob", nestedBlob()).build();
}
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
switch (fieldName) {
case "NestedBlob":
return Optional.ofNullable(clazz.cast(nestedBlob()));
default:
return Optional.empty();
}
}
@Override
public final List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
private static <T> Function<Object, T> getter(Function<StructWithNestedBlobType, T> g) {
return obj -> g.apply((StructWithNestedBlobType) obj);
}
private static <T> BiConsumer<Object, T> setter(BiConsumer<Builder, T> s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
public interface Builder extends SdkPojo, CopyableBuilder<Builder, StructWithNestedBlobType> {
/**
* Sets the value of the NestedBlob property for this object.
*
* @param nestedBlob
* The new value for the NestedBlob property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder nestedBlob(SdkBytes nestedBlob);
}
static final class BuilderImpl implements Builder {
private SdkBytes nestedBlob;
private BuilderImpl() {
}
private BuilderImpl(StructWithNestedBlobType model) {
nestedBlob(model.nestedBlob);
}
public final ByteBuffer getNestedBlob() {
return nestedBlob == null ? null : nestedBlob.asByteBuffer();
}
public final void setNestedBlob(ByteBuffer nestedBlob) {
nestedBlob(nestedBlob == null ? null : SdkBytes.fromByteBuffer(nestedBlob));
}
@Override
public final Builder nestedBlob(SdkBytes nestedBlob) {
this.nestedBlob = nestedBlob;
return this;
}
@Override
public StructWithNestedBlobType build() {
return new StructWithNestedBlobType(this);
}
@Override
public List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
}
}
| 3,431 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/listofintegerscopier.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import static java.util.stream.Collectors.toList;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
@Generated("software.amazon.awssdk:codegen")
final class ListOfIntegersCopier {
static List<Integer> copy(Collection<Integer> listOfIntegersParam) {
List<Integer> list;
if (listOfIntegersParam == null || listOfIntegersParam instanceof SdkAutoConstructList) {
list = DefaultSdkAutoConstructList.getInstance();
} else {
List<Integer> modifiableList = new ArrayList<>();
listOfIntegersParam.forEach(entry -> {
modifiableList.add(entry);
});
list = Collections.unmodifiableList(modifiableList);
}
return list;
}
}
| 3,432 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/inputevent.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import java.io.Serializable;
import java.nio.ByteBuffer;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
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.core.SdkBytes;
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.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public class InputEvent implements SdkPojo, Serializable, ToCopyableBuilder<InputEvent.Builder, InputEvent>, InputEventStream {
private static final SdkField<SdkBytes> EXPLICIT_PAYLOAD_MEMBER_FIELD = SdkField
.<SdkBytes> builder(MarshallingType.SDK_BYTES)
.memberName("ExplicitPayloadMember")
.getter(getter(InputEvent::explicitPayloadMember))
.setter(setter(Builder::explicitPayloadMember))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ExplicitPayloadMember").build(),
PayloadTrait.create()).build();
private static final List<SdkField<?>> SDK_FIELDS = Collections
.unmodifiableList(Arrays.asList(EXPLICIT_PAYLOAD_MEMBER_FIELD));
private static final long serialVersionUID = 1L;
private final SdkBytes explicitPayloadMember;
protected InputEvent(BuilderImpl builder) {
this.explicitPayloadMember = builder.explicitPayloadMember;
}
/**
* Returns the value of the ExplicitPayloadMember property for this object.
*
* @return The value of the ExplicitPayloadMember property for this object.
*/
public final SdkBytes explicitPayloadMember() {
return explicitPayloadMember;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class<? extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(explicitPayloadMember());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof InputEvent)) {
return false;
}
InputEvent other = (InputEvent) obj;
return Objects.equals(explicitPayloadMember(), other.explicitPayloadMember());
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("InputEvent").add("ExplicitPayloadMember", explicitPayloadMember()).build();
}
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
switch (fieldName) {
case "ExplicitPayloadMember":
return Optional.ofNullable(clazz.cast(explicitPayloadMember()));
default:
return Optional.empty();
}
}
@Override
public final InputEvent copy(Consumer<? super Builder> modifier) {
return ToCopyableBuilder.super.copy(modifier);
}
@Override
public final List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
private static <T> Function<Object, T> getter(Function<InputEvent, T> g) {
return obj -> g.apply((InputEvent) obj);
}
private static <T> BiConsumer<Object, T> setter(BiConsumer<Builder, T> s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
public interface Builder extends SdkPojo, CopyableBuilder<Builder, InputEvent> {
/**
* Sets the value of the ExplicitPayloadMember property for this object.
*
* @param explicitPayloadMember
* The new value for the ExplicitPayloadMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder explicitPayloadMember(SdkBytes explicitPayloadMember);
}
protected static class BuilderImpl implements Builder {
private SdkBytes explicitPayloadMember;
protected BuilderImpl() {
}
protected BuilderImpl(InputEvent model) {
explicitPayloadMember(model.explicitPayloadMember);
}
public final ByteBuffer getExplicitPayloadMember() {
return explicitPayloadMember == null ? null : explicitPayloadMember.asByteBuffer();
}
public final void setExplicitPayloadMember(ByteBuffer explicitPayloadMember) {
explicitPayloadMember(explicitPayloadMember == null ? null : SdkBytes.fromByteBuffer(explicitPayloadMember));
}
@Override
public final Builder explicitPayloadMember(SdkBytes explicitPayloadMember) {
this.explicitPayloadMember = explicitPayloadMember;
return this;
}
@Override
public InputEvent build() {
return new InputEvent(this);
}
@Override
public List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
}
}
| 3,433 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/queryparameteroperationrequest.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
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.AwsRequestOverrideConfiguration;
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.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.traits.PayloadTrait;
import software.amazon.awssdk.core.traits.RequiredTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class QueryParameterOperationRequest extends JsonProtocolTestsRequest implements
ToCopyableBuilder<QueryParameterOperationRequest.Builder, QueryParameterOperationRequest> {
private static final SdkField<String> PATH_PARAM_FIELD = SdkField
.<String> builder(MarshallingType.STRING)
.memberName("PathParam")
.getter(getter(QueryParameterOperationRequest::pathParam))
.setter(setter(Builder::pathParam))
.traits(LocationTrait.builder().location(MarshallLocation.PATH).locationName("PathParam").build(),
RequiredTrait.create()).build();
private static final SdkField<String> QUERY_PARAM_ONE_FIELD = SdkField
.<String> builder(MarshallingType.STRING)
.memberName("QueryParamOne")
.getter(getter(QueryParameterOperationRequest::queryParamOne))
.setter(setter(Builder::queryParamOne))
.traits(LocationTrait.builder().location(MarshallLocation.QUERY_PARAM).locationName("QueryParamOne").build(),
RequiredTrait.create()).build();
private static final SdkField<String> QUERY_PARAM_TWO_FIELD = SdkField
.<String> builder(MarshallingType.STRING)
.memberName("QueryParamTwo").getter(getter(QueryParameterOperationRequest::queryParamTwo))
.setter(setter(Builder::queryParamTwo))
.traits(LocationTrait.builder().location(MarshallLocation.QUERY_PARAM).locationName("QueryParamTwo").build()).build();
private static final SdkField<String> STRING_HEADER_MEMBER_FIELD = SdkField
.<String> builder(MarshallingType.STRING)
.memberName("StringHeaderMember")
.getter(getter(QueryParameterOperationRequest::stringHeaderMember))
.setter(setter(Builder::stringHeaderMember))
.traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("x-amz-header-string").build(),
RequiredTrait.create()).build();
private static final SdkField<NestedQueryParameterOperation> NESTED_QUERY_PARAMETER_OPERATION_FIELD = SdkField
.<NestedQueryParameterOperation> builder(MarshallingType.SDK_POJO)
.memberName("NestedQueryParameterOperation")
.getter(getter(QueryParameterOperationRequest::nestedQueryParameterOperation))
.setter(setter(Builder::nestedQueryParameterOperation))
.constructor(NestedQueryParameterOperation::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("NestedQueryParameterOperation")
.build(), PayloadTrait.create()).build();
private static final SdkField<List<Integer>> REQUIRED_LIST_QUERY_PARAMS_FIELD = SdkField
.<List<Integer>> builder(MarshallingType.LIST)
.memberName("RequiredListQueryParams")
.getter(getter(QueryParameterOperationRequest::requiredListQueryParams))
.setter(setter(Builder::requiredListQueryParams))
.traits(LocationTrait.builder().location(MarshallLocation.QUERY_PARAM).locationName("RequiredListQueryParams")
.build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<Integer> builder(MarshallingType.INTEGER)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build(), RequiredTrait.create())
.build();
private static final SdkField<List<Integer>> OPTIONAL_LIST_QUERY_PARAMS_FIELD = SdkField
.<List<Integer>> builder(MarshallingType.LIST)
.memberName("OptionalListQueryParams")
.getter(getter(QueryParameterOperationRequest::optionalListQueryParams))
.setter(setter(Builder::optionalListQueryParams))
.traits(LocationTrait.builder().location(MarshallLocation.QUERY_PARAM).locationName("OptionalListQueryParams")
.build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<Integer> builder(MarshallingType.INTEGER)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(PATH_PARAM_FIELD,
QUERY_PARAM_ONE_FIELD, QUERY_PARAM_TWO_FIELD, STRING_HEADER_MEMBER_FIELD, NESTED_QUERY_PARAMETER_OPERATION_FIELD,
REQUIRED_LIST_QUERY_PARAMS_FIELD, OPTIONAL_LIST_QUERY_PARAMS_FIELD));
private final String pathParam;
private final String queryParamOne;
private final String queryParamTwo;
private final String stringHeaderMember;
private final NestedQueryParameterOperation nestedQueryParameterOperation;
private final List<Integer> requiredListQueryParams;
private final List<Integer> optionalListQueryParams;
private QueryParameterOperationRequest(BuilderImpl builder) {
super(builder);
this.pathParam = builder.pathParam;
this.queryParamOne = builder.queryParamOne;
this.queryParamTwo = builder.queryParamTwo;
this.stringHeaderMember = builder.stringHeaderMember;
this.nestedQueryParameterOperation = builder.nestedQueryParameterOperation;
this.requiredListQueryParams = builder.requiredListQueryParams;
this.optionalListQueryParams = builder.optionalListQueryParams;
}
/**
* Returns the value of the PathParam property for this object.
*
* @return The value of the PathParam property for this object.
*/
public final String pathParam() {
return pathParam;
}
/**
* Returns the value of the QueryParamOne property for this object.
*
* @return The value of the QueryParamOne property for this object.
*/
public final String queryParamOne() {
return queryParamOne;
}
/**
* Returns the value of the QueryParamTwo property for this object.
*
* @return The value of the QueryParamTwo property for this object.
*/
public final String queryParamTwo() {
return queryParamTwo;
}
/**
* Returns the value of the StringHeaderMember property for this object.
*
* @return The value of the StringHeaderMember property for this object.
*/
public final String stringHeaderMember() {
return stringHeaderMember;
}
/**
* Returns the value of the NestedQueryParameterOperation property for this object.
*
* @return The value of the NestedQueryParameterOperation property for this object.
*/
public final NestedQueryParameterOperation nestedQueryParameterOperation() {
return nestedQueryParameterOperation;
}
/**
* For responses, this returns true if the service returned a value for the RequiredListQueryParams property. This
* DOES NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the
* property). This is useful because the SDK will never return a null collection or map, but you may need to
* differentiate between the service returning nothing (or null) and the service returning an empty collection or
* map. For requests, this returns true if a value for the property was specified in the request builder, and false
* if a value was not specified.
*/
public final boolean hasRequiredListQueryParams() {
return requiredListQueryParams != null && !(requiredListQueryParams instanceof SdkAutoConstructList);
}
/**
* Returns the value of the RequiredListQueryParams property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasRequiredListQueryParams} method.
* </p>
*
* @return The value of the RequiredListQueryParams property for this object.
*/
public final List<Integer> requiredListQueryParams() {
return requiredListQueryParams;
}
/**
* For responses, this returns true if the service returned a value for the OptionalListQueryParams property. This
* DOES NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the
* property). This is useful because the SDK will never return a null collection or map, but you may need to
* differentiate between the service returning nothing (or null) and the service returning an empty collection or
* map. For requests, this returns true if a value for the property was specified in the request builder, and false
* if a value was not specified.
*/
public final boolean hasOptionalListQueryParams() {
return optionalListQueryParams != null && !(optionalListQueryParams instanceof SdkAutoConstructList);
}
/**
* Returns the value of the OptionalListQueryParams property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasOptionalListQueryParams} method.
* </p>
*
* @return The value of the OptionalListQueryParams property for this object.
*/
public final List<Integer> optionalListQueryParams() {
return optionalListQueryParams;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class<? extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
hashCode = 31 * hashCode + Objects.hashCode(pathParam());
hashCode = 31 * hashCode + Objects.hashCode(queryParamOne());
hashCode = 31 * hashCode + Objects.hashCode(queryParamTwo());
hashCode = 31 * hashCode + Objects.hashCode(stringHeaderMember());
hashCode = 31 * hashCode + Objects.hashCode(nestedQueryParameterOperation());
hashCode = 31 * hashCode + Objects.hashCode(hasRequiredListQueryParams() ? requiredListQueryParams() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasOptionalListQueryParams() ? optionalListQueryParams() : null);
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof QueryParameterOperationRequest)) {
return false;
}
QueryParameterOperationRequest other = (QueryParameterOperationRequest) obj;
return Objects.equals(pathParam(), other.pathParam()) && Objects.equals(queryParamOne(), other.queryParamOne())
&& Objects.equals(queryParamTwo(), other.queryParamTwo())
&& Objects.equals(stringHeaderMember(), other.stringHeaderMember())
&& Objects.equals(nestedQueryParameterOperation(), other.nestedQueryParameterOperation())
&& hasRequiredListQueryParams() == other.hasRequiredListQueryParams()
&& Objects.equals(requiredListQueryParams(), other.requiredListQueryParams())
&& hasOptionalListQueryParams() == other.hasOptionalListQueryParams()
&& Objects.equals(optionalListQueryParams(), other.optionalListQueryParams());
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("QueryParameterOperationRequest").add("PathParam", pathParam())
.add("QueryParamOne", queryParamOne()).add("QueryParamTwo", queryParamTwo())
.add("StringHeaderMember", stringHeaderMember())
.add("NestedQueryParameterOperation", nestedQueryParameterOperation())
.add("RequiredListQueryParams", hasRequiredListQueryParams() ? requiredListQueryParams() : null)
.add("OptionalListQueryParams", hasOptionalListQueryParams() ? optionalListQueryParams() : null).build();
}
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
switch (fieldName) {
case "PathParam":
return Optional.ofNullable(clazz.cast(pathParam()));
case "QueryParamOne":
return Optional.ofNullable(clazz.cast(queryParamOne()));
case "QueryParamTwo":
return Optional.ofNullable(clazz.cast(queryParamTwo()));
case "StringHeaderMember":
return Optional.ofNullable(clazz.cast(stringHeaderMember()));
case "NestedQueryParameterOperation":
return Optional.ofNullable(clazz.cast(nestedQueryParameterOperation()));
case "RequiredListQueryParams":
return Optional.ofNullable(clazz.cast(requiredListQueryParams()));
case "OptionalListQueryParams":
return Optional.ofNullable(clazz.cast(optionalListQueryParams()));
default:
return Optional.empty();
}
}
@Override
public final List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
private static <T> Function<Object, T> getter(Function<QueryParameterOperationRequest, T> g) {
return obj -> g.apply((QueryParameterOperationRequest) obj);
}
private static <T> BiConsumer<Object, T> setter(BiConsumer<Builder, T> s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
public interface Builder extends JsonProtocolTestsRequest.Builder, SdkPojo,
CopyableBuilder<Builder, QueryParameterOperationRequest> {
/**
* Sets the value of the PathParam property for this object.
*
* @param pathParam
* The new value for the PathParam property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder pathParam(String pathParam);
/**
* Sets the value of the QueryParamOne property for this object.
*
* @param queryParamOne
* The new value for the QueryParamOne property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder queryParamOne(String queryParamOne);
/**
* Sets the value of the QueryParamTwo property for this object.
*
* @param queryParamTwo
* The new value for the QueryParamTwo property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder queryParamTwo(String queryParamTwo);
/**
* Sets the value of the StringHeaderMember property for this object.
*
* @param stringHeaderMember
* The new value for the StringHeaderMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder stringHeaderMember(String stringHeaderMember);
/**
* Sets the value of the NestedQueryParameterOperation property for this object.
*
* @param nestedQueryParameterOperation
* The new value for the NestedQueryParameterOperation property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder nestedQueryParameterOperation(NestedQueryParameterOperation nestedQueryParameterOperation);
/**
* Sets the value of the NestedQueryParameterOperation property for this object.
*
* This is a convenience method that creates an instance of the {@link NestedQueryParameterOperation.Builder}
* avoiding the need to create one manually via {@link NestedQueryParameterOperation#builder()}.
*
* <p>
* When the {@link Consumer} completes, {@link NestedQueryParameterOperation.Builder#build()} is called
* immediately and its result is passed to {@link #nestedQueryParameterOperation(NestedQueryParameterOperation)}.
*
* @param nestedQueryParameterOperation
* a consumer that will call methods on {@link NestedQueryParameterOperation.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #nestedQueryParameterOperation(NestedQueryParameterOperation)
*/
default Builder nestedQueryParameterOperation(
Consumer<NestedQueryParameterOperation.Builder> nestedQueryParameterOperation) {
return nestedQueryParameterOperation(NestedQueryParameterOperation.builder()
.applyMutation(nestedQueryParameterOperation).build());
}
/**
* Sets the value of the RequiredListQueryParams property for this object.
*
* @param requiredListQueryParams
* The new value for the RequiredListQueryParams property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder requiredListQueryParams(Collection<Integer> requiredListQueryParams);
/**
* Sets the value of the RequiredListQueryParams property for this object.
*
* @param requiredListQueryParams
* The new value for the RequiredListQueryParams property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder requiredListQueryParams(Integer... requiredListQueryParams);
/**
* Sets the value of the OptionalListQueryParams property for this object.
*
* @param optionalListQueryParams
* The new value for the OptionalListQueryParams property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder optionalListQueryParams(Collection<Integer> optionalListQueryParams);
/**
* Sets the value of the OptionalListQueryParams property for this object.
*
* @param optionalListQueryParams
* The new value for the OptionalListQueryParams property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder optionalListQueryParams(Integer... optionalListQueryParams);
@Override
Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration);
@Override
Builder overrideConfiguration(Consumer<AwsRequestOverrideConfiguration.Builder> builderConsumer);
}
static final class BuilderImpl extends JsonProtocolTestsRequest.BuilderImpl implements Builder {
private String pathParam;
private String queryParamOne;
private String queryParamTwo;
private String stringHeaderMember;
private NestedQueryParameterOperation nestedQueryParameterOperation;
private List<Integer> requiredListQueryParams = DefaultSdkAutoConstructList.getInstance();
private List<Integer> optionalListQueryParams = DefaultSdkAutoConstructList.getInstance();
private BuilderImpl() {
}
private BuilderImpl(QueryParameterOperationRequest model) {
super(model);
pathParam(model.pathParam);
queryParamOne(model.queryParamOne);
queryParamTwo(model.queryParamTwo);
stringHeaderMember(model.stringHeaderMember);
nestedQueryParameterOperation(model.nestedQueryParameterOperation);
requiredListQueryParams(model.requiredListQueryParams);
optionalListQueryParams(model.optionalListQueryParams);
}
public final String getPathParam() {
return pathParam;
}
public final void setPathParam(String pathParam) {
this.pathParam = pathParam;
}
@Override
public final Builder pathParam(String pathParam) {
this.pathParam = pathParam;
return this;
}
public final String getQueryParamOne() {
return queryParamOne;
}
public final void setQueryParamOne(String queryParamOne) {
this.queryParamOne = queryParamOne;
}
@Override
public final Builder queryParamOne(String queryParamOne) {
this.queryParamOne = queryParamOne;
return this;
}
public final String getQueryParamTwo() {
return queryParamTwo;
}
public final void setQueryParamTwo(String queryParamTwo) {
this.queryParamTwo = queryParamTwo;
}
@Override
public final Builder queryParamTwo(String queryParamTwo) {
this.queryParamTwo = queryParamTwo;
return this;
}
public final String getStringHeaderMember() {
return stringHeaderMember;
}
public final void setStringHeaderMember(String stringHeaderMember) {
this.stringHeaderMember = stringHeaderMember;
}
@Override
public final Builder stringHeaderMember(String stringHeaderMember) {
this.stringHeaderMember = stringHeaderMember;
return this;
}
public final NestedQueryParameterOperation.Builder getNestedQueryParameterOperation() {
return nestedQueryParameterOperation != null ? nestedQueryParameterOperation.toBuilder() : null;
}
public final void setNestedQueryParameterOperation(NestedQueryParameterOperation.BuilderImpl nestedQueryParameterOperation) {
this.nestedQueryParameterOperation = nestedQueryParameterOperation != null ? nestedQueryParameterOperation.build()
: null;
}
@Override
public final Builder nestedQueryParameterOperation(NestedQueryParameterOperation nestedQueryParameterOperation) {
this.nestedQueryParameterOperation = nestedQueryParameterOperation;
return this;
}
public final Collection<Integer> getRequiredListQueryParams() {
if (requiredListQueryParams instanceof SdkAutoConstructList) {
return null;
}
return requiredListQueryParams;
}
public final void setRequiredListQueryParams(Collection<Integer> requiredListQueryParams) {
this.requiredListQueryParams = ListOfIntegersCopier.copy(requiredListQueryParams);
}
@Override
public final Builder requiredListQueryParams(Collection<Integer> requiredListQueryParams) {
this.requiredListQueryParams = ListOfIntegersCopier.copy(requiredListQueryParams);
return this;
}
@Override
@SafeVarargs
public final Builder requiredListQueryParams(Integer... requiredListQueryParams) {
requiredListQueryParams(Arrays.asList(requiredListQueryParams));
return this;
}
public final Collection<Integer> getOptionalListQueryParams() {
if (optionalListQueryParams instanceof SdkAutoConstructList) {
return null;
}
return optionalListQueryParams;
}
public final void setOptionalListQueryParams(Collection<Integer> optionalListQueryParams) {
this.optionalListQueryParams = ListOfIntegersCopier.copy(optionalListQueryParams);
}
@Override
public final Builder optionalListQueryParams(Collection<Integer> optionalListQueryParams) {
this.optionalListQueryParams = ListOfIntegersCopier.copy(optionalListQueryParams);
return this;
}
@Override
@SafeVarargs
public final Builder optionalListQueryParams(Integer... optionalListQueryParams) {
optionalListQueryParams(Arrays.asList(optionalListQueryParams));
return this;
}
@Override
public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) {
super.overrideConfiguration(overrideConfiguration);
return this;
}
@Override
public Builder overrideConfiguration(Consumer<AwsRequestOverrideConfiguration.Builder> builderConsumer) {
super.overrideConfiguration(builderConsumer);
return this;
}
@Override
public QueryParameterOperationRequest build() {
return new QueryParameterOperationRequest(this);
}
@Override
public List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
}
}
| 3,434 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/structwithtimestamp.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import java.io.Serializable;
import java.time.Instant;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
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.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class StructWithTimestamp implements SdkPojo, Serializable,
ToCopyableBuilder<StructWithTimestamp.Builder, StructWithTimestamp> {
private static final SdkField<Instant> NESTED_TIMESTAMP_FIELD = SdkField.<Instant> builder(MarshallingType.INSTANT)
.memberName("NestedTimestamp").getter(getter(StructWithTimestamp::nestedTimestamp))
.setter(setter(Builder::nestedTimestamp))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("NestedTimestamp").build()).build();
private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(NESTED_TIMESTAMP_FIELD));
private static final long serialVersionUID = 1L;
private final Instant nestedTimestamp;
private StructWithTimestamp(BuilderImpl builder) {
this.nestedTimestamp = builder.nestedTimestamp;
}
/**
* Returns the value of the NestedTimestamp property for this object.
*
* @return The value of the NestedTimestamp property for this object.
*/
public final Instant nestedTimestamp() {
return nestedTimestamp;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class<? extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(nestedTimestamp());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof StructWithTimestamp)) {
return false;
}
StructWithTimestamp other = (StructWithTimestamp) obj;
return Objects.equals(nestedTimestamp(), other.nestedTimestamp());
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("StructWithTimestamp").add("NestedTimestamp", nestedTimestamp()).build();
}
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
switch (fieldName) {
case "NestedTimestamp":
return Optional.ofNullable(clazz.cast(nestedTimestamp()));
default:
return Optional.empty();
}
}
@Override
public final List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
private static <T> Function<Object, T> getter(Function<StructWithTimestamp, T> g) {
return obj -> g.apply((StructWithTimestamp) obj);
}
private static <T> BiConsumer<Object, T> setter(BiConsumer<Builder, T> s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
public interface Builder extends SdkPojo, CopyableBuilder<Builder, StructWithTimestamp> {
/**
* Sets the value of the NestedTimestamp property for this object.
*
* @param nestedTimestamp
* The new value for the NestedTimestamp property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder nestedTimestamp(Instant nestedTimestamp);
}
static final class BuilderImpl implements Builder {
private Instant nestedTimestamp;
private BuilderImpl() {
}
private BuilderImpl(StructWithTimestamp model) {
nestedTimestamp(model.nestedTimestamp);
}
public final Instant getNestedTimestamp() {
return nestedTimestamp;
}
public final void setNestedTimestamp(Instant nestedTimestamp) {
this.nestedTimestamp = nestedTimestamp;
}
@Override
public final Builder nestedTimestamp(Instant nestedTimestamp) {
this.nestedTimestamp = nestedTimestamp;
return this;
}
@Override
public StructWithTimestamp build() {
return new StructWithTimestamp(this);
}
@Override
public List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
}
}
| 3,435 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/listofmapofenumtostringcopier.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import static java.util.stream.Collectors.toList;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
@Generated("software.amazon.awssdk:codegen")
final class ListOfMapOfEnumToStringCopier {
static List<Map<String, String>> copy(Collection<? extends Map<String, String>> listOfMapOfEnumToStringParam) {
List<Map<String, String>> list;
if (listOfMapOfEnumToStringParam == null || listOfMapOfEnumToStringParam instanceof SdkAutoConstructList) {
list = DefaultSdkAutoConstructList.getInstance();
} else {
List<Map<String, String>> modifiableList = new ArrayList<>();
listOfMapOfEnumToStringParam.forEach(entry -> {
Map<String, String> map;
if (entry == null || entry instanceof SdkAutoConstructMap) {
map = DefaultSdkAutoConstructMap.getInstance();
} else {
Map<String, String> modifiableMap = new LinkedHashMap<>();
entry.forEach((key, value) -> {
modifiableMap.put(key, value);
});
map = Collections.unmodifiableMap(modifiableMap);
}
modifiableList.add(map);
});
list = Collections.unmodifiableList(modifiableList);
}
return list;
}
static List<Map<String, String>> copyEnumToString(Collection<? extends Map<EnumType, String>> listOfMapOfEnumToStringParam) {
List<Map<String, String>> list;
if (listOfMapOfEnumToStringParam == null || listOfMapOfEnumToStringParam instanceof SdkAutoConstructList) {
list = DefaultSdkAutoConstructList.getInstance();
} else {
List<Map<String, String>> modifiableList = new ArrayList<>();
listOfMapOfEnumToStringParam.forEach(entry -> {
Map<String, String> map;
if (entry == null || entry instanceof SdkAutoConstructMap) {
map = DefaultSdkAutoConstructMap.getInstance();
} else {
Map<String, String> modifiableMap = new LinkedHashMap<>();
entry.forEach((key, value) -> {
String result = key.toString();
modifiableMap.put(result, value);
});
map = Collections.unmodifiableMap(modifiableMap);
}
modifiableList.add(map);
});
list = Collections.unmodifiableList(modifiableList);
}
return list;
}
static List<Map<EnumType, String>> copyStringToEnum(Collection<? extends Map<String, String>> listOfMapOfEnumToStringParam) {
List<Map<EnumType, String>> list;
if (listOfMapOfEnumToStringParam == null || listOfMapOfEnumToStringParam instanceof SdkAutoConstructList) {
list = DefaultSdkAutoConstructList.getInstance();
} else {
List<Map<EnumType, String>> modifiableList = new ArrayList<>();
listOfMapOfEnumToStringParam.forEach(entry -> {
Map<EnumType, String> map;
if (entry == null || entry instanceof SdkAutoConstructMap) {
map = DefaultSdkAutoConstructMap.getInstance();
} else {
Map<EnumType, String> modifiableMap = new LinkedHashMap<>();
entry.forEach((key, value) -> {
EnumType result = EnumType.fromValue(key);
if (result != EnumType.UNKNOWN_TO_SDK_VERSION) {
modifiableMap.put(result, value);
}
});
map = Collections.unmodifiableMap(modifiableMap);
}
modifiableList.add(map);
});
list = Collections.unmodifiableList(modifiableList);
}
return list;
}
}
| 3,436 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/listofsimplestructscopier.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import static java.util.stream.Collectors.toList;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
@Generated("software.amazon.awssdk:codegen")
final class ListOfSimpleStructsCopier {
static List<SimpleStruct> copy(Collection<? extends SimpleStruct> listOfSimpleStructsParam) {
List<SimpleStruct> list;
if (listOfSimpleStructsParam == null || listOfSimpleStructsParam instanceof SdkAutoConstructList) {
list = DefaultSdkAutoConstructList.getInstance();
} else {
List<SimpleStruct> modifiableList = new ArrayList<>();
listOfSimpleStructsParam.forEach(entry -> {
modifiableList.add(entry);
});
list = Collections.unmodifiableList(modifiableList);
}
return list;
}
static List<SimpleStruct> copyFromBuilder(Collection<? extends SimpleStruct.Builder> listOfSimpleStructsParam) {
List<SimpleStruct> list;
if (listOfSimpleStructsParam == null || listOfSimpleStructsParam instanceof SdkAutoConstructList) {
list = DefaultSdkAutoConstructList.getInstance();
} else {
List<SimpleStruct> modifiableList = new ArrayList<>();
listOfSimpleStructsParam.forEach(entry -> {
SimpleStruct member = entry == null ? null : entry.build();
modifiableList.add(member);
});
list = Collections.unmodifiableList(modifiableList);
}
return list;
}
static List<SimpleStruct.Builder> copyToBuilder(Collection<? extends SimpleStruct> listOfSimpleStructsParam) {
List<SimpleStruct.Builder> list;
if (listOfSimpleStructsParam == null || listOfSimpleStructsParam instanceof SdkAutoConstructList) {
list = DefaultSdkAutoConstructList.getInstance();
} else {
List<SimpleStruct.Builder> modifiableList = new ArrayList<>();
listOfSimpleStructsParam.forEach(entry -> {
SimpleStruct.Builder member = entry == null ? null : entry.toBuilder();
modifiableList.add(member);
});
list = Collections.unmodifiableList(modifiableList);
}
return list;
}
}
| 3,437 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/recursivestructtype.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import software.amazon.awssdk.annotations.Generated;
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.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.traits.MapTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class RecursiveStructType implements SdkPojo, Serializable,
ToCopyableBuilder<RecursiveStructType.Builder, RecursiveStructType> {
private static final SdkField<String> NO_RECURSE_FIELD = SdkField.<String> builder(MarshallingType.STRING)
.memberName("NoRecurse").getter(getter(RecursiveStructType::noRecurse)).setter(setter(Builder::noRecurse))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("NoRecurse").build()).build();
private static final SdkField<RecursiveStructType> RECURSIVE_STRUCT_FIELD = SdkField
.<RecursiveStructType> builder(MarshallingType.SDK_POJO).memberName("RecursiveStruct")
.getter(getter(RecursiveStructType::recursiveStruct)).setter(setter(Builder::recursiveStruct))
.constructor(RecursiveStructType::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RecursiveStruct").build()).build();
private static final SdkField<List<RecursiveStructType>> RECURSIVE_LIST_FIELD = SdkField
.<List<RecursiveStructType>> builder(MarshallingType.LIST)
.memberName("RecursiveList")
.getter(getter(RecursiveStructType::recursiveList))
.setter(setter(Builder::recursiveList))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RecursiveList").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<RecursiveStructType> builder(MarshallingType.SDK_POJO)
.constructor(RecursiveStructType::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField<Map<String, RecursiveStructType>> RECURSIVE_MAP_FIELD = SdkField
.<Map<String, RecursiveStructType>> builder(MarshallingType.MAP)
.memberName("RecursiveMap")
.getter(getter(RecursiveStructType::recursiveMap))
.setter(setter(Builder::recursiveMap))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RecursiveMap").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<RecursiveStructType> builder(MarshallingType.SDK_POJO)
.constructor(RecursiveStructType::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build()).build()).build();
private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(NO_RECURSE_FIELD,
RECURSIVE_STRUCT_FIELD, RECURSIVE_LIST_FIELD, RECURSIVE_MAP_FIELD));
private static final long serialVersionUID = 1L;
private final String noRecurse;
private final RecursiveStructType recursiveStruct;
private final List<RecursiveStructType> recursiveList;
private final Map<String, RecursiveStructType> recursiveMap;
private RecursiveStructType(BuilderImpl builder) {
this.noRecurse = builder.noRecurse;
this.recursiveStruct = builder.recursiveStruct;
this.recursiveList = builder.recursiveList;
this.recursiveMap = builder.recursiveMap;
}
/**
* Returns the value of the NoRecurse property for this object.
*
* @return The value of the NoRecurse property for this object.
*/
public final String noRecurse() {
return noRecurse;
}
/**
* Returns the value of the RecursiveStruct property for this object.
*
* @return The value of the RecursiveStruct property for this object.
*/
public final RecursiveStructType recursiveStruct() {
return recursiveStruct;
}
/**
* For responses, this returns true if the service returned a value for the RecursiveList property. This DOES NOT
* check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property).
* This is useful because the SDK will never return a null collection or map, but you may need to differentiate
* between the service returning nothing (or null) and the service returning an empty collection or map. For
* requests, this returns true if a value for the property was specified in the request builder, and false if a
* value was not specified.
*/
public final boolean hasRecursiveList() {
return recursiveList != null && !(recursiveList instanceof SdkAutoConstructList);
}
/**
* Returns the value of the RecursiveList property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasRecursiveList} method.
* </p>
*
* @return The value of the RecursiveList property for this object.
*/
public final List<RecursiveStructType> recursiveList() {
return recursiveList;
}
/**
* For responses, this returns true if the service returned a value for the RecursiveMap property. This DOES NOT
* check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property).
* This is useful because the SDK will never return a null collection or map, but you may need to differentiate
* between the service returning nothing (or null) and the service returning an empty collection or map. For
* requests, this returns true if a value for the property was specified in the request builder, and false if a
* value was not specified.
*/
public final boolean hasRecursiveMap() {
return recursiveMap != null && !(recursiveMap instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the RecursiveMap property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasRecursiveMap} method.
* </p>
*
* @return The value of the RecursiveMap property for this object.
*/
public final Map<String, RecursiveStructType> recursiveMap() {
return recursiveMap;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class<? extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(noRecurse());
hashCode = 31 * hashCode + Objects.hashCode(recursiveStruct());
hashCode = 31 * hashCode + Objects.hashCode(hasRecursiveList() ? recursiveList() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasRecursiveMap() ? recursiveMap() : null);
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof RecursiveStructType)) {
return false;
}
RecursiveStructType other = (RecursiveStructType) obj;
return Objects.equals(noRecurse(), other.noRecurse()) && Objects.equals(recursiveStruct(), other.recursiveStruct())
&& hasRecursiveList() == other.hasRecursiveList() && Objects.equals(recursiveList(), other.recursiveList())
&& hasRecursiveMap() == other.hasRecursiveMap() && Objects.equals(recursiveMap(), other.recursiveMap());
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("RecursiveStructType").add("NoRecurse", noRecurse()).add("RecursiveStruct", recursiveStruct())
.add("RecursiveList", hasRecursiveList() ? recursiveList() : null)
.add("RecursiveMap", hasRecursiveMap() ? recursiveMap() : null).build();
}
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
switch (fieldName) {
case "NoRecurse":
return Optional.ofNullable(clazz.cast(noRecurse()));
case "RecursiveStruct":
return Optional.ofNullable(clazz.cast(recursiveStruct()));
case "RecursiveList":
return Optional.ofNullable(clazz.cast(recursiveList()));
case "RecursiveMap":
return Optional.ofNullable(clazz.cast(recursiveMap()));
default:
return Optional.empty();
}
}
@Override
public final List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
private static <T> Function<Object, T> getter(Function<RecursiveStructType, T> g) {
return obj -> g.apply((RecursiveStructType) obj);
}
private static <T> BiConsumer<Object, T> setter(BiConsumer<Builder, T> s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
public interface Builder extends SdkPojo, CopyableBuilder<Builder, RecursiveStructType> {
/**
* Sets the value of the NoRecurse property for this object.
*
* @param noRecurse
* The new value for the NoRecurse property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder noRecurse(String noRecurse);
/**
* Sets the value of the RecursiveStruct property for this object.
*
* @param recursiveStruct
* The new value for the RecursiveStruct property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder recursiveStruct(RecursiveStructType recursiveStruct);
/**
* Sets the value of the RecursiveStruct property for this object.
*
* This is a convenience method that creates an instance of the {@link RecursiveStructType.Builder} avoiding the
* need to create one manually via {@link RecursiveStructType#builder()}.
*
* <p>
* When the {@link Consumer} completes, {@link RecursiveStructType.Builder#build()} is called immediately and
* its result is passed to {@link #recursiveStruct(RecursiveStructType)}.
*
* @param recursiveStruct
* a consumer that will call methods on {@link RecursiveStructType.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #recursiveStruct(RecursiveStructType)
*/
default Builder recursiveStruct(Consumer<Builder> recursiveStruct) {
return recursiveStruct(RecursiveStructType.builder().applyMutation(recursiveStruct).build());
}
/**
* Sets the value of the RecursiveList property for this object.
*
* @param recursiveList
* The new value for the RecursiveList property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder recursiveList(Collection<RecursiveStructType> recursiveList);
/**
* Sets the value of the RecursiveList property for this object.
*
* @param recursiveList
* The new value for the RecursiveList property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder recursiveList(RecursiveStructType... recursiveList);
/**
* Sets the value of the RecursiveList property for this object.
*
* This is a convenience method that creates an instance of the
* {@link software.amazon.awssdk.services.jsonprotocoltests.model.RecursiveStructType.Builder} avoiding the need
* to create one manually via
* {@link software.amazon.awssdk.services.jsonprotocoltests.model.RecursiveStructType#builder()}.
*
* <p>
* When the {@link Consumer} completes,
* {@link software.amazon.awssdk.services.jsonprotocoltests.model.RecursiveStructType.Builder#build()} is called
* immediately and its result is passed to {@link #recursiveList(List<RecursiveStructType>)}.
*
* @param recursiveList
* a consumer that will call methods on
* {@link software.amazon.awssdk.services.jsonprotocoltests.model.RecursiveStructType.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #recursiveList(java.util.Collection<RecursiveStructType>)
*/
Builder recursiveList(Consumer<Builder>... recursiveList);
/**
* Sets the value of the RecursiveMap property for this object.
*
* @param recursiveMap
* The new value for the RecursiveMap property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder recursiveMap(Map<String, RecursiveStructType> recursiveMap);
}
static final class BuilderImpl implements Builder {
private String noRecurse;
private RecursiveStructType recursiveStruct;
private List<RecursiveStructType> recursiveList = DefaultSdkAutoConstructList.getInstance();
private Map<String, RecursiveStructType> recursiveMap = DefaultSdkAutoConstructMap.getInstance();
private BuilderImpl() {
}
private BuilderImpl(RecursiveStructType model) {
noRecurse(model.noRecurse);
recursiveStruct(model.recursiveStruct);
recursiveList(model.recursiveList);
recursiveMap(model.recursiveMap);
}
public final String getNoRecurse() {
return noRecurse;
}
public final void setNoRecurse(String noRecurse) {
this.noRecurse = noRecurse;
}
@Override
public final Builder noRecurse(String noRecurse) {
this.noRecurse = noRecurse;
return this;
}
public final Builder getRecursiveStruct() {
return recursiveStruct != null ? recursiveStruct.toBuilder() : null;
}
public final void setRecursiveStruct(BuilderImpl recursiveStruct) {
this.recursiveStruct = recursiveStruct != null ? recursiveStruct.build() : null;
}
@Override
public final Builder recursiveStruct(RecursiveStructType recursiveStruct) {
this.recursiveStruct = recursiveStruct;
return this;
}
public final List<Builder> getRecursiveList() {
List<Builder> result = RecursiveListTypeCopier.copyToBuilder(this.recursiveList);
if (result instanceof SdkAutoConstructList) {
return null;
}
return result;
}
public final void setRecursiveList(Collection<BuilderImpl> recursiveList) {
this.recursiveList = RecursiveListTypeCopier.copyFromBuilder(recursiveList);
}
@Override
public final Builder recursiveList(Collection<RecursiveStructType> recursiveList) {
this.recursiveList = RecursiveListTypeCopier.copy(recursiveList);
return this;
}
@Override
@SafeVarargs
public final Builder recursiveList(RecursiveStructType... recursiveList) {
recursiveList(Arrays.asList(recursiveList));
return this;
}
@Override
@SafeVarargs
public final Builder recursiveList(Consumer<Builder>... recursiveList) {
recursiveList(Stream.of(recursiveList).map(c -> RecursiveStructType.builder().applyMutation(c).build())
.collect(Collectors.toList()));
return this;
}
public final Map<String, Builder> getRecursiveMap() {
Map<String, Builder> result = RecursiveMapTypeCopier.copyToBuilder(this.recursiveMap);
if (result instanceof SdkAutoConstructMap) {
return null;
}
return result;
}
public final void setRecursiveMap(Map<String, BuilderImpl> recursiveMap) {
this.recursiveMap = RecursiveMapTypeCopier.copyFromBuilder(recursiveMap);
}
@Override
public final Builder recursiveMap(Map<String, RecursiveStructType> recursiveMap) {
this.recursiveMap = RecursiveMapTypeCopier.copy(recursiveMap);
return this;
}
@Override
public RecursiveStructType build() {
return new RecursiveStructType(this);
}
@Override
public List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
}
}
| 3,438 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/listofmapstringtostringcopier.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import static java.util.stream.Collectors.toList;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
@Generated("software.amazon.awssdk:codegen")
final class ListOfMapStringToStringCopier {
static List<Map<String, String>> copy(Collection<? extends Map<String, String>> listOfMapStringToStringParam) {
List<Map<String, String>> list;
if (listOfMapStringToStringParam == null || listOfMapStringToStringParam instanceof SdkAutoConstructList) {
list = DefaultSdkAutoConstructList.getInstance();
} else {
List<Map<String, String>> modifiableList = new ArrayList<>();
listOfMapStringToStringParam.forEach(entry -> {
Map<String, String> map;
if (entry == null || entry instanceof SdkAutoConstructMap) {
map = DefaultSdkAutoConstructMap.getInstance();
} else {
Map<String, String> modifiableMap = new LinkedHashMap<>();
entry.forEach((key, value) -> {
modifiableMap.put(key, value);
});
map = Collections.unmodifiableMap(modifiableMap);
}
modifiableList.add(map);
});
list = Collections.unmodifiableList(modifiableList);
}
return list;
}
}
| 3,439 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/eventstream.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import java.util.Collections;
import java.util.EnumSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.annotations.SdkPublicApi;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.services.jsonprotocoltests.model.eventstream.DefaultEventOne;
import software.amazon.awssdk.services.jsonprotocoltests.model.eventstream.DefaultEventTwo;
import software.amazon.awssdk.services.jsonprotocoltests.model.eventstream.DefaultEventthree;
import software.amazon.awssdk.services.jsonprotocoltests.model.eventstream.DefaultSecondEventOne;
import software.amazon.awssdk.services.jsonprotocoltests.model.eventstream.DefaultSecondEventTwo;
import software.amazon.awssdk.utils.internal.EnumUtils;
/**
* Base interface for all event types in EventStream.
*/
@Generated("software.amazon.awssdk:codegen")
@SdkPublicApi
public interface EventStream extends SdkPojo {
/**
* Special type of {@link EventStream} for unknown types of events that this version of the SDK does not know about
*/
EventStream UNKNOWN = new EventStream() {
@Override
public List<SdkField<?>> sdkFields() {
return Collections.emptyList();
}
@Override
public void accept(EventStreamOperationResponseHandler.Visitor visitor) {
visitor.visitDefault(this);
}
};
/**
* Create a builder for the {@code EventOne} event type for this stream.
*/
static EventOne.Builder eventOneBuilder() {
return DefaultEventOne.builder();
}
/**
* Create a builder for the {@code SecondEventOne} event type for this stream.
*/
static EventOne.Builder secondEventOneBuilder() {
return DefaultSecondEventOne.builder();
}
/**
* Create a builder for the {@code EventTwo} event type for this stream.
*/
static EventTwo.Builder eventTwoBuilder() {
return DefaultEventTwo.builder();
}
/**
* Create a builder for the {@code SecondEventTwo} event type for this stream.
*/
static EventTwo.Builder secondEventTwoBuilder() {
return DefaultSecondEventTwo.builder();
}
/**
* Create a builder for the {@code eventthree} event type for this stream.
*/
static EventTwo.Builder eventthreeBuilder() {
return DefaultEventthree.builder();
}
/**
* The type of this event. Corresponds to the {@code :event-type} header on the Message.
*/
default EventType sdkEventType() {
return EventType.UNKNOWN_TO_SDK_VERSION;
}
/**
* Calls the appropriate visit method depending on the subtype of {@link EventStream}.
*
* @param visitor
* Visitor to invoke.
*/
void accept(EventStreamOperationResponseHandler.Visitor visitor);
/**
* The known possible types of events for {@code EventStream}.
*/
@Generated("software.amazon.awssdk:codegen")
enum EventType {
EVENT_ONE("EventOne"),
SECOND_EVENT_ONE("SecondEventOne"),
EVENT_TWO("EventTwo"),
SECOND_EVENT_TWO("SecondEventTwo"),
EVENTTHREE("eventthree"),
UNKNOWN_TO_SDK_VERSION(null);
private static final Map<String, EventType> VALUE_MAP = EnumUtils.uniqueIndex(EventType.class, EventType::toString);
private final String value;
private EventType(String value) {
this.value = value;
}
@Override
public String toString() {
return String.valueOf(value);
}
/**
* Use this in place of valueOf to convert the raw string returned by the service into the enum value.
*
* @param value
* real value
* @return EventType corresponding to the value
*/
public static EventType fromValue(String value) {
if (value == null) {
return null;
}
return VALUE_MAP.getOrDefault(value, UNKNOWN_TO_SDK_VERSION);
}
/**
* Use this in place of {@link #values()} to return a {@link Set} of all values known to the SDK. This will
* return all known enum values except {@link #UNKNOWN_TO_SDK_VERSION}.
*
* @return a {@link Set} of known {@link EventType}s
*/
public static Set<EventType> knownValues() {
Set<EventType> knownValues = EnumSet.allOf(EventType.class);
knownValues.remove(UNKNOWN_TO_SDK_VERSION);
return knownValues;
}
}
}
| 3,440 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/listofstringscopier.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import static java.util.stream.Collectors.toList;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
@Generated("software.amazon.awssdk:codegen")
final class ListOfStringsCopier {
static List<String> copy(Collection<String> listOfStringsParam) {
List<String> list;
if (listOfStringsParam == null || listOfStringsParam instanceof SdkAutoConstructList) {
list = DefaultSdkAutoConstructList.getInstance();
} else {
List<String> modifiableList = new ArrayList<>();
listOfStringsParam.forEach(entry -> {
modifiableList.add(entry);
});
list = Collections.unmodifiableList(modifiableList);
}
return list;
}
}
| 3,441 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/nestedcontainersrequest.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
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.AwsRequestOverrideConfiguration;
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.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.traits.MapTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class NestedContainersRequest extends JsonProtocolTestsRequest implements
ToCopyableBuilder<NestedContainersRequest.Builder, NestedContainersRequest> {
private static final SdkField<List<List<String>>> LIST_OF_LIST_OF_STRINGS_FIELD = SdkField
.<List<List<String>>> builder(MarshallingType.LIST)
.memberName("ListOfListOfStrings")
.getter(getter(NestedContainersRequest::listOfListOfStrings))
.setter(setter(Builder::listOfListOfStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ListOfListOfStrings").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<List<String>> builder(MarshallingType.LIST)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder()
.location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build())
.build()).build()).build()).build();
private static final SdkField<List<List<List<String>>>> LIST_OF_LIST_OF_LIST_OF_STRINGS_FIELD = SdkField
.<List<List<List<String>>>> builder(MarshallingType.LIST)
.memberName("ListOfListOfListOfStrings")
.getter(getter(NestedContainersRequest::listOfListOfListOfStrings))
.setter(setter(Builder::listOfListOfListOfStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ListOfListOfListOfStrings").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<List<List<String>>> builder(MarshallingType.LIST)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<List<String>> builder(MarshallingType.LIST)
.traits(LocationTrait.builder()
.location(MarshallLocation.PAYLOAD)
.locationName("member").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<String> builder(
MarshallingType.STRING)
.traits(LocationTrait
.builder()
.location(
MarshallLocation.PAYLOAD)
.locationName(
"member")
.build())
.build()).build())
.build()).build()).build()).build()).build();
private static final SdkField<Map<String, List<List<String>>>> MAP_OF_STRING_TO_LIST_OF_LIST_OF_STRINGS_FIELD = SdkField
.<Map<String, List<List<String>>>> builder(MarshallingType.MAP)
.memberName("MapOfStringToListOfListOfStrings")
.getter(getter(NestedContainersRequest::mapOfStringToListOfListOfStrings))
.setter(setter(Builder::mapOfStringToListOfListOfStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MapOfStringToListOfListOfStrings")
.build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<List<List<String>>> builder(MarshallingType.LIST)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<List<String>> builder(MarshallingType.LIST)
.traits(LocationTrait.builder()
.location(MarshallLocation.PAYLOAD)
.locationName("member").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<String> builder(
MarshallingType.STRING)
.traits(LocationTrait
.builder()
.location(
MarshallLocation.PAYLOAD)
.locationName(
"member")
.build())
.build()).build())
.build()).build()).build()).build()).build();
private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(LIST_OF_LIST_OF_STRINGS_FIELD,
LIST_OF_LIST_OF_LIST_OF_STRINGS_FIELD, MAP_OF_STRING_TO_LIST_OF_LIST_OF_STRINGS_FIELD));
private final List<List<String>> listOfListOfStrings;
private final List<List<List<String>>> listOfListOfListOfStrings;
private final Map<String, List<List<String>>> mapOfStringToListOfListOfStrings;
private NestedContainersRequest(BuilderImpl builder) {
super(builder);
this.listOfListOfStrings = builder.listOfListOfStrings;
this.listOfListOfListOfStrings = builder.listOfListOfListOfStrings;
this.mapOfStringToListOfListOfStrings = builder.mapOfStringToListOfListOfStrings;
}
/**
* For responses, this returns true if the service returned a value for the ListOfListOfStrings property. This DOES
* NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property).
* This is useful because the SDK will never return a null collection or map, but you may need to differentiate
* between the service returning nothing (or null) and the service returning an empty collection or map. For
* requests, this returns true if a value for the property was specified in the request builder, and false if a
* value was not specified.
*/
public final boolean hasListOfListOfStrings() {
return listOfListOfStrings != null && !(listOfListOfStrings instanceof SdkAutoConstructList);
}
/**
* Returns the value of the ListOfListOfStrings property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasListOfListOfStrings} method.
* </p>
*
* @return The value of the ListOfListOfStrings property for this object.
*/
public final List<List<String>> listOfListOfStrings() {
return listOfListOfStrings;
}
/**
* For responses, this returns true if the service returned a value for the ListOfListOfListOfStrings property. This
* DOES NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the
* property). This is useful because the SDK will never return a null collection or map, but you may need to
* differentiate between the service returning nothing (or null) and the service returning an empty collection or
* map. For requests, this returns true if a value for the property was specified in the request builder, and false
* if a value was not specified.
*/
public final boolean hasListOfListOfListOfStrings() {
return listOfListOfListOfStrings != null && !(listOfListOfListOfStrings instanceof SdkAutoConstructList);
}
/**
* Returns the value of the ListOfListOfListOfStrings property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasListOfListOfListOfStrings} method.
* </p>
*
* @return The value of the ListOfListOfListOfStrings property for this object.
*/
public final List<List<List<String>>> listOfListOfListOfStrings() {
return listOfListOfListOfStrings;
}
/**
* For responses, this returns true if the service returned a value for the MapOfStringToListOfListOfStrings
* property. This DOES NOT check that the value is non-empty (for which, you should check the {@code isEmpty()}
* method on the property). This is useful because the SDK will never return a null collection or map, but you may
* need to differentiate between the service returning nothing (or null) and the service returning an empty
* collection or map. For requests, this returns true if a value for the property was specified in the request
* builder, and false if a value was not specified.
*/
public final boolean hasMapOfStringToListOfListOfStrings() {
return mapOfStringToListOfListOfStrings != null && !(mapOfStringToListOfListOfStrings instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the MapOfStringToListOfListOfStrings property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasMapOfStringToListOfListOfStrings}
* method.
* </p>
*
* @return The value of the MapOfStringToListOfListOfStrings property for this object.
*/
public final Map<String, List<List<String>>> mapOfStringToListOfListOfStrings() {
return mapOfStringToListOfListOfStrings;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class<? extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
hashCode = 31 * hashCode + Objects.hashCode(hasListOfListOfStrings() ? listOfListOfStrings() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasListOfListOfListOfStrings() ? listOfListOfListOfStrings() : null);
hashCode = 31 * hashCode
+ Objects.hashCode(hasMapOfStringToListOfListOfStrings() ? mapOfStringToListOfListOfStrings() : null);
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof NestedContainersRequest)) {
return false;
}
NestedContainersRequest other = (NestedContainersRequest) obj;
return hasListOfListOfStrings() == other.hasListOfListOfStrings()
&& Objects.equals(listOfListOfStrings(), other.listOfListOfStrings())
&& hasListOfListOfListOfStrings() == other.hasListOfListOfListOfStrings()
&& Objects.equals(listOfListOfListOfStrings(), other.listOfListOfListOfStrings())
&& hasMapOfStringToListOfListOfStrings() == other.hasMapOfStringToListOfListOfStrings()
&& Objects.equals(mapOfStringToListOfListOfStrings(), other.mapOfStringToListOfListOfStrings());
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString
.builder("NestedContainersRequest")
.add("ListOfListOfStrings", hasListOfListOfStrings() ? listOfListOfStrings() : null)
.add("ListOfListOfListOfStrings", hasListOfListOfListOfStrings() ? listOfListOfListOfStrings() : null)
.add("MapOfStringToListOfListOfStrings",
hasMapOfStringToListOfListOfStrings() ? mapOfStringToListOfListOfStrings() : null).build();
}
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
switch (fieldName) {
case "ListOfListOfStrings":
return Optional.ofNullable(clazz.cast(listOfListOfStrings()));
case "ListOfListOfListOfStrings":
return Optional.ofNullable(clazz.cast(listOfListOfListOfStrings()));
case "MapOfStringToListOfListOfStrings":
return Optional.ofNullable(clazz.cast(mapOfStringToListOfListOfStrings()));
default:
return Optional.empty();
}
}
@Override
public final List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
private static <T> Function<Object, T> getter(Function<NestedContainersRequest, T> g) {
return obj -> g.apply((NestedContainersRequest) obj);
}
private static <T> BiConsumer<Object, T> setter(BiConsumer<Builder, T> s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
public interface Builder extends JsonProtocolTestsRequest.Builder, SdkPojo, CopyableBuilder<Builder, NestedContainersRequest> {
/**
* Sets the value of the ListOfListOfStrings property for this object.
*
* @param listOfListOfStrings
* The new value for the ListOfListOfStrings property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfListOfStrings(Collection<? extends Collection<String>> listOfListOfStrings);
/**
* Sets the value of the ListOfListOfStrings property for this object.
*
* @param listOfListOfStrings
* The new value for the ListOfListOfStrings property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfListOfStrings(Collection<String>... listOfListOfStrings);
/**
* Sets the value of the ListOfListOfListOfStrings property for this object.
*
* @param listOfListOfListOfStrings
* The new value for the ListOfListOfListOfStrings property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfListOfListOfStrings(Collection<? extends Collection<? extends Collection<String>>> listOfListOfListOfStrings);
/**
* Sets the value of the ListOfListOfListOfStrings property for this object.
*
* @param listOfListOfListOfStrings
* The new value for the ListOfListOfListOfStrings property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfListOfListOfStrings(Collection<? extends Collection<String>>... listOfListOfListOfStrings);
/**
* Sets the value of the MapOfStringToListOfListOfStrings property for this object.
*
* @param mapOfStringToListOfListOfStrings
* The new value for the MapOfStringToListOfListOfStrings property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfStringToListOfListOfStrings(
Map<String, ? extends Collection<? extends Collection<String>>> mapOfStringToListOfListOfStrings);
@Override
Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration);
@Override
Builder overrideConfiguration(Consumer<AwsRequestOverrideConfiguration.Builder> builderConsumer);
}
static final class BuilderImpl extends JsonProtocolTestsRequest.BuilderImpl implements Builder {
private List<List<String>> listOfListOfStrings = DefaultSdkAutoConstructList.getInstance();
private List<List<List<String>>> listOfListOfListOfStrings = DefaultSdkAutoConstructList.getInstance();
private Map<String, List<List<String>>> mapOfStringToListOfListOfStrings = DefaultSdkAutoConstructMap.getInstance();
private BuilderImpl() {
}
private BuilderImpl(NestedContainersRequest model) {
super(model);
listOfListOfStrings(model.listOfListOfStrings);
listOfListOfListOfStrings(model.listOfListOfListOfStrings);
mapOfStringToListOfListOfStrings(model.mapOfStringToListOfListOfStrings);
}
public final Collection<? extends Collection<String>> getListOfListOfStrings() {
if (listOfListOfStrings instanceof SdkAutoConstructList) {
return null;
}
return listOfListOfStrings;
}
public final void setListOfListOfStrings(Collection<? extends Collection<String>> listOfListOfStrings) {
this.listOfListOfStrings = ListOfListOfStringsCopier.copy(listOfListOfStrings);
}
@Override
public final Builder listOfListOfStrings(Collection<? extends Collection<String>> listOfListOfStrings) {
this.listOfListOfStrings = ListOfListOfStringsCopier.copy(listOfListOfStrings);
return this;
}
@Override
@SafeVarargs
public final Builder listOfListOfStrings(Collection<String>... listOfListOfStrings) {
listOfListOfStrings(Arrays.asList(listOfListOfStrings));
return this;
}
public final Collection<? extends Collection<? extends Collection<String>>> getListOfListOfListOfStrings() {
if (listOfListOfListOfStrings instanceof SdkAutoConstructList) {
return null;
}
return listOfListOfListOfStrings;
}
public final void setListOfListOfListOfStrings(
Collection<? extends Collection<? extends Collection<String>>> listOfListOfListOfStrings) {
this.listOfListOfListOfStrings = ListOfListOfListOfStringsCopier.copy(listOfListOfListOfStrings);
}
@Override
public final Builder listOfListOfListOfStrings(
Collection<? extends Collection<? extends Collection<String>>> listOfListOfListOfStrings) {
this.listOfListOfListOfStrings = ListOfListOfListOfStringsCopier.copy(listOfListOfListOfStrings);
return this;
}
@Override
@SafeVarargs
public final Builder listOfListOfListOfStrings(Collection<? extends Collection<String>>... listOfListOfListOfStrings) {
listOfListOfListOfStrings(Arrays.asList(listOfListOfListOfStrings));
return this;
}
public final Map<String, ? extends Collection<? extends Collection<String>>> getMapOfStringToListOfListOfStrings() {
if (mapOfStringToListOfListOfStrings instanceof SdkAutoConstructMap) {
return null;
}
return mapOfStringToListOfListOfStrings;
}
public final void setMapOfStringToListOfListOfStrings(
Map<String, ? extends Collection<? extends Collection<String>>> mapOfStringToListOfListOfStrings) {
this.mapOfStringToListOfListOfStrings = MapOfStringToListOfListOfStringsCopier.copy(mapOfStringToListOfListOfStrings);
}
@Override
public final Builder mapOfStringToListOfListOfStrings(
Map<String, ? extends Collection<? extends Collection<String>>> mapOfStringToListOfListOfStrings) {
this.mapOfStringToListOfListOfStrings = MapOfStringToListOfListOfStringsCopier.copy(mapOfStringToListOfListOfStrings);
return this;
}
@Override
public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) {
super.overrideConfiguration(overrideConfiguration);
return this;
}
@Override
public Builder overrideConfiguration(Consumer<AwsRequestOverrideConfiguration.Builder> builderConsumer) {
super.overrideConfiguration(builderConsumer);
return this;
}
@Override
public NestedContainersRequest build() {
return new NestedContainersRequest(this);
}
@Override
public List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
}
}
| 3,442 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/underscore_name_type.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class Underscore_Name_Type implements SdkPojo, Serializable,
ToCopyableBuilder<Underscore_Name_Type.Builder, Underscore_Name_Type> {
private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList());
private static final long serialVersionUID = 1L;
private Underscore_Name_Type(BuilderImpl builder) {
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class<? extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof Underscore_Name_Type)) {
return false;
}
return true;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("Underscore_Name_Type").build();
}
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
return Optional.empty();
}
@Override
public final List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
public interface Builder extends SdkPojo, CopyableBuilder<Builder, Underscore_Name_Type> {
}
static final class BuilderImpl implements Builder {
private BuilderImpl() {
}
private BuilderImpl(Underscore_Name_Type model) {
}
@Override
public Underscore_Name_Type build() {
return new Underscore_Name_Type(this);
}
@Override
public List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
}
}
| 3,443 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/enumtype.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.utils.ToString;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class EnumType {
private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList());
private EnumType(EnumType.BuilderImpl builder) {
}
@Override
public EnumType.Builder toBuilder() {
return new EnumType.BuilderImpl(this);
}
public static EnumType.Builder builder() {
return new EnumType.BuilderImpl();
}
public static Class<? extends EnumType.Builder> serializableBuilderClass() {
return EnumType.BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof EnumType)) {
return false;
}
return true;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("EnumType").build();
}
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
return Optional.empty();
}
@Override
public final List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
}
| 3,444 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/recursivemaptypecopier.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import static java.util.stream.Collectors.toMap;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.Map;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
@Generated("software.amazon.awssdk:codegen")
final class RecursiveMapTypeCopier {
static Map<String, RecursiveStructType> copy(Map<String, ? extends RecursiveStructType> recursiveMapTypeParam) {
Map<String, RecursiveStructType> map;
if (recursiveMapTypeParam == null || recursiveMapTypeParam instanceof SdkAutoConstructMap) {
map = DefaultSdkAutoConstructMap.getInstance();
} else {
Map<String, RecursiveStructType> modifiableMap = new LinkedHashMap<>();
recursiveMapTypeParam.forEach((key, value) -> {
modifiableMap.put(key, value);
});
map = Collections.unmodifiableMap(modifiableMap);
}
return map;
}
static Map<String, RecursiveStructType> copyFromBuilder(
Map<String, ? extends RecursiveStructType.Builder> recursiveMapTypeParam) {
Map<String, RecursiveStructType> map;
if (recursiveMapTypeParam == null || recursiveMapTypeParam instanceof SdkAutoConstructMap) {
map = DefaultSdkAutoConstructMap.getInstance();
} else {
Map<String, RecursiveStructType> modifiableMap = new LinkedHashMap<>();
recursiveMapTypeParam.forEach((key, value) -> {
RecursiveStructType member = value == null ? null : value.build();
modifiableMap.put(key, member);
});
map = Collections.unmodifiableMap(modifiableMap);
}
return map;
}
static Map<String, RecursiveStructType.Builder> copyToBuilder(Map<String, ? extends RecursiveStructType> recursiveMapTypeParam) {
Map<String, RecursiveStructType.Builder> map;
if (recursiveMapTypeParam == null || recursiveMapTypeParam instanceof SdkAutoConstructMap) {
map = DefaultSdkAutoConstructMap.getInstance();
} else {
Map<String, RecursiveStructType.Builder> modifiableMap = new LinkedHashMap<>();
recursiveMapTypeParam.forEach((key, value) -> {
RecursiveStructType.Builder member = value == null ? null : value.toBuilder();
modifiableMap.put(key, member);
});
map = Collections.unmodifiableMap(modifiableMap);
}
return map;
}
}
| 3,445 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/mapofenumtomapofstringtoenumcopier.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import static java.util.stream.Collectors.toMap;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.Map;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
@Generated("software.amazon.awssdk:codegen")
final class MapOfEnumToMapOfStringToEnumCopier {
static Map<String, Map<String, String>> copy(Map<String, ? extends Map<String, String>> mapOfEnumToMapOfStringToEnumParam) {
Map<String, Map<String, String>> map;
if (mapOfEnumToMapOfStringToEnumParam == null || mapOfEnumToMapOfStringToEnumParam instanceof SdkAutoConstructMap) {
map = DefaultSdkAutoConstructMap.getInstance();
} else {
Map<String, Map<String, String>> modifiableMap = new LinkedHashMap<>();
mapOfEnumToMapOfStringToEnumParam.forEach((key, value) -> {
Map<String, String> map1;
if (value == null || value instanceof SdkAutoConstructMap) {
map1 = DefaultSdkAutoConstructMap.getInstance();
} else {
Map<String, String> modifiableMap1 = new LinkedHashMap<>();
value.forEach((key1, value1) -> {
modifiableMap1.put(key1, value1);
});
map1 = Collections.unmodifiableMap(modifiableMap1);
}
modifiableMap.put(key, map1);
});
map = Collections.unmodifiableMap(modifiableMap);
}
return map;
}
static Map<String, Map<String, String>> copyEnumToString(
Map<EnumType, ? extends Map<String, EnumType>> mapOfEnumToMapOfStringToEnumParam) {
Map<String, Map<String, String>> map;
if (mapOfEnumToMapOfStringToEnumParam == null || mapOfEnumToMapOfStringToEnumParam instanceof SdkAutoConstructMap) {
map = DefaultSdkAutoConstructMap.getInstance();
} else {
Map<String, Map<String, String>> modifiableMap = new LinkedHashMap<>();
mapOfEnumToMapOfStringToEnumParam.forEach((key, value) -> {
String result = key.toString();
Map<String, String> map1;
if (value == null || value instanceof SdkAutoConstructMap) {
map1 = DefaultSdkAutoConstructMap.getInstance();
} else {
Map<String, String> modifiableMap1 = new LinkedHashMap<>();
value.forEach((key1, value1) -> {
String result1 = value1.toString();
modifiableMap1.put(key1, result1);
});
map1 = Collections.unmodifiableMap(modifiableMap1);
}
modifiableMap.put(result, map1);
});
map = Collections.unmodifiableMap(modifiableMap);
}
return map;
}
static Map<EnumType, Map<String, EnumType>> copyStringToEnum(
Map<String, ? extends Map<String, String>> mapOfEnumToMapOfStringToEnumParam) {
Map<EnumType, Map<String, EnumType>> map;
if (mapOfEnumToMapOfStringToEnumParam == null || mapOfEnumToMapOfStringToEnumParam instanceof SdkAutoConstructMap) {
map = DefaultSdkAutoConstructMap.getInstance();
} else {
Map<EnumType, Map<String, EnumType>> modifiableMap = new LinkedHashMap<>();
mapOfEnumToMapOfStringToEnumParam.forEach((key, value) -> {
EnumType result = EnumType.fromValue(key);
Map<String, EnumType> map1;
if (value == null || value instanceof SdkAutoConstructMap) {
map1 = DefaultSdkAutoConstructMap.getInstance();
} else {
Map<String, EnumType> modifiableMap1 = new LinkedHashMap<>();
value.forEach((key1, value1) -> {
EnumType result1 = EnumType.fromValue(value1);
modifiableMap1.put(key1, result1);
});
map1 = Collections.unmodifiableMap(modifiableMap1);
}
if (result != EnumType.UNKNOWN_TO_SDK_VERSION) {
modifiableMap.put(result, map1);
}
});
map = Collections.unmodifiableMap(modifiableMap);
}
return map;
}
}
| 3,446 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/inputeventstreamtwo.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import java.util.EnumSet;
import java.util.Map;
import java.util.Set;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.annotations.SdkPublicApi;
import software.amazon.awssdk.services.jsonprotocoltests.model.inputeventstreamtwo.DefaultInputEventTwo;
import software.amazon.awssdk.utils.internal.EnumUtils;
/**
* Base interface for all event types in InputEventStreamTwo.
*/
@Generated("software.amazon.awssdk:codegen")
@SdkPublicApi
public interface InputEventStreamTwo {
/**
* Create a builder for the {@code InputEventTwo} event type for this stream.
*/
static InputEventTwo.Builder inputEventTwoBuilder() {
return DefaultInputEventTwo.builder();
}
/**
* The type of this event. Corresponds to the {@code :event-type} header on the Message.
*/
default EventType sdkEventType() {
return EventType.UNKNOWN_TO_SDK_VERSION;
}
/**
* The known possible types of events for {@code InputEventStreamTwo}.
*/
@Generated("software.amazon.awssdk:codegen")
enum EventType {
INPUT_EVENT_TWO("InputEventTwo"),
UNKNOWN_TO_SDK_VERSION(null);
private static final Map<String, EventType> VALUE_MAP = EnumUtils.uniqueIndex(EventType.class, EventType::toString);
private final String value;
private EventType(String value) {
this.value = value;
}
@Override
public String toString() {
return String.valueOf(value);
}
/**
* Use this in place of valueOf to convert the raw string returned by the service into the enum value.
*
* @param value
* real value
* @return EventType corresponding to the value
*/
public static EventType fromValue(String value) {
if (value == null) {
return null;
}
return VALUE_MAP.getOrDefault(value, UNKNOWN_TO_SDK_VERSION);
}
/**
* Use this in place of {@link #values()} to return a {@link Set} of all values known to the SDK. This will
* return all known enum values except {@link #UNKNOWN_TO_SDK_VERSION}.
*
* @return a {@link Set} of known {@link EventType}s
*/
public static Set<EventType> knownValues() {
Set<EventType> knownValues = EnumSet.allOf(EventType.class);
knownValues.remove(UNKNOWN_TO_SDK_VERSION);
return knownValues;
}
}
}
| 3,447 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/listofmapofstringtostructcopier.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import static java.util.stream.Collectors.toList;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
@Generated("software.amazon.awssdk:codegen")
final class ListOfMapOfStringToStructCopier {
static List<Map<String, SimpleStruct>> copy(
Collection<? extends Map<String, ? extends SimpleStruct>> listOfMapOfStringToStructParam) {
List<Map<String, SimpleStruct>> list;
if (listOfMapOfStringToStructParam == null || listOfMapOfStringToStructParam instanceof SdkAutoConstructList) {
list = DefaultSdkAutoConstructList.getInstance();
} else {
List<Map<String, SimpleStruct>> modifiableList = new ArrayList<>();
listOfMapOfStringToStructParam.forEach(entry -> {
Map<String, SimpleStruct> map;
if (entry == null || entry instanceof SdkAutoConstructMap) {
map = DefaultSdkAutoConstructMap.getInstance();
} else {
Map<String, SimpleStruct> modifiableMap = new LinkedHashMap<>();
entry.forEach((key, value) -> {
modifiableMap.put(key, value);
});
map = Collections.unmodifiableMap(modifiableMap);
}
modifiableList.add(map);
});
list = Collections.unmodifiableList(modifiableList);
}
return list;
}
static List<Map<String, SimpleStruct>> copyFromBuilder(
Collection<? extends Map<String, ? extends SimpleStruct.Builder>> listOfMapOfStringToStructParam) {
List<Map<String, SimpleStruct>> list;
if (listOfMapOfStringToStructParam == null || listOfMapOfStringToStructParam instanceof SdkAutoConstructList) {
list = DefaultSdkAutoConstructList.getInstance();
} else {
List<Map<String, SimpleStruct>> modifiableList = new ArrayList<>();
listOfMapOfStringToStructParam.forEach(entry -> {
Map<String, SimpleStruct> map;
if (entry == null || entry instanceof SdkAutoConstructMap) {
map = DefaultSdkAutoConstructMap.getInstance();
} else {
Map<String, SimpleStruct> modifiableMap = new LinkedHashMap<>();
entry.forEach((key, value) -> {
SimpleStruct member = value == null ? null : value.build();
modifiableMap.put(key, member);
});
map = Collections.unmodifiableMap(modifiableMap);
}
modifiableList.add(map);
});
list = Collections.unmodifiableList(modifiableList);
}
return list;
}
static List<Map<String, SimpleStruct.Builder>> copyToBuilder(
Collection<? extends Map<String, ? extends SimpleStruct>> listOfMapOfStringToStructParam) {
List<Map<String, SimpleStruct.Builder>> list;
if (listOfMapOfStringToStructParam == null || listOfMapOfStringToStructParam instanceof SdkAutoConstructList) {
list = DefaultSdkAutoConstructList.getInstance();
} else {
List<Map<String, SimpleStruct.Builder>> modifiableList = new ArrayList<>();
listOfMapOfStringToStructParam.forEach(entry -> {
Map<String, SimpleStruct.Builder> map;
if (entry == null || entry instanceof SdkAutoConstructMap) {
map = DefaultSdkAutoConstructMap.getInstance();
} else {
Map<String, SimpleStruct.Builder> modifiableMap = new LinkedHashMap<>();
entry.forEach((key, value) -> {
SimpleStruct.Builder member = value == null ? null : value.toBuilder();
modifiableMap.put(key, member);
});
map = Collections.unmodifiableMap(modifiableMap);
}
modifiableList.add(map);
});
list = Collections.unmodifiableList(modifiableList);
}
return list;
}
}
| 3,448 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/serviceclientconfiguration.java | package software.amazon.awssdk.services.jsonprotocoltests;
import java.net.URI;
import java.util.Map;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.annotations.SdkPublicApi;
import software.amazon.awssdk.awscore.AwsServiceClientConfiguration;
import software.amazon.awssdk.core.client.config.ClientOverrideConfiguration;
import software.amazon.awssdk.endpoints.EndpointProvider;
import software.amazon.awssdk.http.auth.spi.scheme.AuthScheme;
import software.amazon.awssdk.identity.spi.AwsCredentialsIdentity;
import software.amazon.awssdk.identity.spi.IdentityProvider;
import software.amazon.awssdk.regions.Region;
import software.amazon.awssdk.services.jsonprotocoltests.auth.scheme.JsonProtocolTestsAuthSchemeProvider;
import software.amazon.awssdk.services.jsonprotocoltests.internal.JsonProtocolTestsServiceClientConfigurationBuilder;
/**
* Class to expose the service client settings to the user. Implementation of {@link AwsServiceClientConfiguration}
*/
@Generated("software.amazon.awssdk:codegen")
@SdkPublicApi
public final class JsonProtocolTestsServiceClientConfiguration extends AwsServiceClientConfiguration {
private final JsonProtocolTestsAuthSchemeProvider authSchemeProvider;
public JsonProtocolTestsServiceClientConfiguration(Builder builder) {
super(builder);
this.authSchemeProvider = builder.authSchemeProvider();
}
public static Builder builder() {
return new JsonProtocolTestsServiceClientConfigurationBuilder();
}
/**
* Gets the value for auth scheme provider
*/
public JsonProtocolTestsAuthSchemeProvider authSchemeProvider() {
return authSchemeProvider;
}
/**
* A builder for creating a {@link JsonProtocolTestsServiceClientConfiguration}
*/
public interface Builder extends AwsServiceClientConfiguration.Builder {
/**
* Sets the value for client override configuration
*/
@Override
Builder overrideConfiguration(ClientOverrideConfiguration overrideConfiguration);
/**
* Gets the value for client override configuration
*/
@Override
ClientOverrideConfiguration overrideConfiguration();
/**
* Sets the value for endpoint override
*/
@Override
Builder endpointOverride(URI endpointOverride);
/**
* Gets the value for endpoint override
*/
@Override
URI endpointOverride();
/**
* Sets the value for endpoint provider
*/
@Override
Builder endpointProvider(EndpointProvider endpointProvider);
/**
* Gets the value for endpoint provider
*/
@Override
EndpointProvider endpointProvider();
/**
* Sets the value for AWS region
*/
@Override
Builder region(Region region);
/**
* Gets the value for AWS region
*/
@Override
Region region();
/**
* Sets the value for credentials provider
*/
@Override
Builder credentialsProvider(IdentityProvider<? extends AwsCredentialsIdentity> credentialsProvider);
/**
* Gets the value for credentials provider
*/
@Override
IdentityProvider<? extends AwsCredentialsIdentity> credentialsProvider();
@Override
Builder putAuthScheme(AuthScheme<?> authScheme);
/**
* Gets the value for auth schemes
*/
@Override
Map<String, AuthScheme<?>> authSchemes();
/**
* Sets the value for auth scheme provider
*/
Builder authSchemeProvider(JsonProtocolTestsAuthSchemeProvider authSchemeProvider);
/**
* Gets the value for auth scheme provider
*/
JsonProtocolTestsAuthSchemeProvider authSchemeProvider();
@Override
JsonProtocolTestsServiceClientConfiguration build();
}
}
| 3,449 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/eventtwo.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
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.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.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public class EventTwo implements SdkPojo, Serializable, ToCopyableBuilder<EventTwo.Builder, EventTwo>, EventStream {
private static final SdkField<String> BAR_FIELD = SdkField.<String> builder(MarshallingType.STRING).memberName("Bar")
.getter(getter(EventTwo::bar)).setter(setter(Builder::bar))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Bar").build()).build();
private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(BAR_FIELD));
private static final long serialVersionUID = 1L;
private final String bar;
protected EventTwo(BuilderImpl builder) {
this.bar = builder.bar;
}
/**
* Returns the value of the Bar property for this object.
*
* @return The value of the Bar property for this object.
*/
public final String bar() {
return bar;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class<? extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(bar());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof EventTwo)) {
return false;
}
EventTwo other = (EventTwo) obj;
return Objects.equals(bar(), other.bar());
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("EventTwo").add("Bar", bar()).build();
}
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
switch (fieldName) {
case "Bar":
return Optional.ofNullable(clazz.cast(bar()));
default:
return Optional.empty();
}
}
@Override
public final EventTwo copy(Consumer<? super Builder> modifier) {
return ToCopyableBuilder.super.copy(modifier);
}
@Override
public final List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
private static <T> Function<Object, T> getter(Function<EventTwo, T> g) {
return obj -> g.apply((EventTwo) obj);
}
private static <T> BiConsumer<Object, T> setter(BiConsumer<Builder, T> s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
/**
* Calls the appropriate visit method depending on the subtype of {@link EventTwo}.
*
* @param visitor
* Visitor to invoke.
*/
@Override
public void accept(EventStreamOperationResponseHandler.Visitor visitor) {
throw new UnsupportedOperationException();
}
public interface Builder extends SdkPojo, CopyableBuilder<Builder, EventTwo> {
/**
* Sets the value of the Bar property for this object.
*
* @param bar
* The new value for the Bar property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder bar(String bar);
}
protected static class BuilderImpl implements Builder {
private String bar;
protected BuilderImpl() {
}
protected BuilderImpl(EventTwo model) {
bar(model.bar);
}
public final String getBar() {
return bar;
}
public final void setBar(String bar) {
this.bar = bar;
}
@Override
public final Builder bar(String bar) {
this.bar = bar;
return this;
}
@Override
public EventTwo build() {
return new EventTwo(this);
}
@Override
public List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
}
}
| 3,450 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/alltypesresponse.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import java.nio.ByteBuffer;
import java.time.Instant;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkBytes;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.document.Document;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.traits.MapTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class AllTypesResponse extends JsonProtocolTestsResponse implements
ToCopyableBuilder<AllTypesResponse.Builder, AllTypesResponse> {
private static final SdkField<String> STRING_MEMBER_FIELD = SdkField.<String> builder(MarshallingType.STRING)
.memberName("StringMember").getter(getter(AllTypesResponse::stringMember)).setter(setter(Builder::stringMember))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StringMember").build()).build();
private static final SdkField<Integer> INTEGER_MEMBER_FIELD = SdkField.<Integer> builder(MarshallingType.INTEGER)
.memberName("IntegerMember").getter(getter(AllTypesResponse::integerMember)).setter(setter(Builder::integerMember))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("IntegerMember").build()).build();
private static final SdkField<Boolean> BOOLEAN_MEMBER_FIELD = SdkField.<Boolean> builder(MarshallingType.BOOLEAN)
.memberName("BooleanMember").getter(getter(AllTypesResponse::booleanMember)).setter(setter(Builder::booleanMember))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("BooleanMember").build()).build();
private static final SdkField<Float> FLOAT_MEMBER_FIELD = SdkField.<Float> builder(MarshallingType.FLOAT)
.memberName("FloatMember").getter(getter(AllTypesResponse::floatMember)).setter(setter(Builder::floatMember))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("FloatMember").build()).build();
private static final SdkField<Double> DOUBLE_MEMBER_FIELD = SdkField.<Double> builder(MarshallingType.DOUBLE)
.memberName("DoubleMember").getter(getter(AllTypesResponse::doubleMember)).setter(setter(Builder::doubleMember))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DoubleMember").build()).build();
private static final SdkField<Long> LONG_MEMBER_FIELD = SdkField.<Long> builder(MarshallingType.LONG)
.memberName("LongMember").getter(getter(AllTypesResponse::longMember)).setter(setter(Builder::longMember))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LongMember").build()).build();
private static final SdkField<Short> SHORT_MEMBER_FIELD = SdkField.<Short> builder(MarshallingType.SHORT)
.memberName("ShortMember").getter(getter(AllTypesResponse::shortMember)).setter(setter(Builder::shortMember))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ShortMember").build()).build();
private static final SdkField<List<String>> SIMPLE_LIST_FIELD = SdkField
.<List<String>> builder(MarshallingType.LIST)
.memberName("SimpleList")
.getter(getter(AllTypesResponse::simpleList))
.setter(setter(Builder::simpleList))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SimpleList").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField<List<String>> LIST_OF_ENUMS_FIELD = SdkField
.<List<String>> builder(MarshallingType.LIST)
.memberName("ListOfEnums")
.getter(getter(AllTypesResponse::listOfEnumsAsStrings))
.setter(setter(Builder::listOfEnumsWithStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ListOfEnums").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField<List<Map<String, String>>> LIST_OF_MAPS_FIELD = SdkField
.<List<Map<String, String>>> builder(MarshallingType.LIST)
.memberName("ListOfMaps")
.getter(getter(AllTypesResponse::listOfMaps))
.setter(setter(Builder::listOfMaps))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ListOfMaps").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<Map<String, String>> builder(MarshallingType.MAP)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder()
.location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build())
.build()).build()).build()).build();
private static final SdkField<List<SimpleStruct>> LIST_OF_STRUCTS_FIELD = SdkField
.<List<SimpleStruct>> builder(MarshallingType.LIST)
.memberName("ListOfStructs")
.getter(getter(AllTypesResponse::listOfStructs))
.setter(setter(Builder::listOfStructs))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ListOfStructs").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<SimpleStruct> builder(MarshallingType.SDK_POJO)
.constructor(SimpleStruct::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField<List<Map<String, String>>> LIST_OF_MAP_OF_ENUM_TO_STRING_FIELD = SdkField
.<List<Map<String, String>>> builder(MarshallingType.LIST)
.memberName("ListOfMapOfEnumToString")
.getter(getter(AllTypesResponse::listOfMapOfEnumToStringAsStrings))
.setter(setter(Builder::listOfMapOfEnumToStringWithStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ListOfMapOfEnumToString").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<Map<String, String>> builder(MarshallingType.MAP)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder()
.location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build())
.build()).build()).build()).build();
private static final SdkField<List<Map<String, SimpleStruct>>> LIST_OF_MAP_OF_STRING_TO_STRUCT_FIELD = SdkField
.<List<Map<String, SimpleStruct>>> builder(MarshallingType.LIST)
.memberName("ListOfMapOfStringToStruct")
.getter(getter(AllTypesResponse::listOfMapOfStringToStruct))
.setter(setter(Builder::listOfMapOfStringToStruct))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ListOfMapOfStringToStruct").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<Map<String, SimpleStruct>> builder(MarshallingType.MAP)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<SimpleStruct> builder(MarshallingType.SDK_POJO)
.constructor(SimpleStruct::builder)
.traits(LocationTrait.builder()
.location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build())
.build()).build()).build()).build();
private static final SdkField<Map<String, List<Integer>>> MAP_OF_STRING_TO_INTEGER_LIST_FIELD = SdkField
.<Map<String, List<Integer>>> builder(MarshallingType.MAP)
.memberName("MapOfStringToIntegerList")
.getter(getter(AllTypesResponse::mapOfStringToIntegerList))
.setter(setter(Builder::mapOfStringToIntegerList))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MapOfStringToIntegerList").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<List<Integer>> builder(MarshallingType.LIST)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<Integer> builder(MarshallingType.INTEGER)
.traits(LocationTrait.builder()
.location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build())
.build()).build()).build()).build();
private static final SdkField<Map<String, String>> MAP_OF_STRING_TO_STRING_FIELD = SdkField
.<Map<String, String>> builder(MarshallingType.MAP)
.memberName("MapOfStringToString")
.getter(getter(AllTypesResponse::mapOfStringToString))
.setter(setter(Builder::mapOfStringToString))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MapOfStringToString").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build()).build()).build();
private static final SdkField<Map<String, SimpleStruct>> MAP_OF_STRING_TO_SIMPLE_STRUCT_FIELD = SdkField
.<Map<String, SimpleStruct>> builder(MarshallingType.MAP)
.memberName("MapOfStringToSimpleStruct")
.getter(getter(AllTypesResponse::mapOfStringToSimpleStruct))
.setter(setter(Builder::mapOfStringToSimpleStruct))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MapOfStringToSimpleStruct").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<SimpleStruct> builder(MarshallingType.SDK_POJO)
.constructor(SimpleStruct::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build()).build()).build();
private static final SdkField<Map<String, String>> MAP_OF_ENUM_TO_ENUM_FIELD = SdkField
.<Map<String, String>> builder(MarshallingType.MAP)
.memberName("MapOfEnumToEnum")
.getter(getter(AllTypesResponse::mapOfEnumToEnumAsStrings))
.setter(setter(Builder::mapOfEnumToEnumWithStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MapOfEnumToEnum").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build()).build()).build();
private static final SdkField<Map<String, String>> MAP_OF_ENUM_TO_STRING_FIELD = SdkField
.<Map<String, String>> builder(MarshallingType.MAP)
.memberName("MapOfEnumToString")
.getter(getter(AllTypesResponse::mapOfEnumToStringAsStrings))
.setter(setter(Builder::mapOfEnumToStringWithStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MapOfEnumToString").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build()).build()).build();
private static final SdkField<Map<String, String>> MAP_OF_STRING_TO_ENUM_FIELD = SdkField
.<Map<String, String>> builder(MarshallingType.MAP)
.memberName("MapOfStringToEnum")
.getter(getter(AllTypesResponse::mapOfStringToEnumAsStrings))
.setter(setter(Builder::mapOfStringToEnumWithStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MapOfStringToEnum").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build()).build()).build();
private static final SdkField<Map<String, SimpleStruct>> MAP_OF_ENUM_TO_SIMPLE_STRUCT_FIELD = SdkField
.<Map<String, SimpleStruct>> builder(MarshallingType.MAP)
.memberName("MapOfEnumToSimpleStruct")
.getter(getter(AllTypesResponse::mapOfEnumToSimpleStructAsStrings))
.setter(setter(Builder::mapOfEnumToSimpleStructWithStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MapOfEnumToSimpleStruct").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<SimpleStruct> builder(MarshallingType.SDK_POJO)
.constructor(SimpleStruct::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build()).build()).build();
private static final SdkField<Map<String, List<String>>> MAP_OF_ENUM_TO_LIST_OF_ENUMS_FIELD = SdkField
.<Map<String, List<String>>> builder(MarshallingType.MAP)
.memberName("MapOfEnumToListOfEnums")
.getter(getter(AllTypesResponse::mapOfEnumToListOfEnumsAsStrings))
.setter(setter(Builder::mapOfEnumToListOfEnumsWithStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MapOfEnumToListOfEnums").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<List<String>> builder(MarshallingType.LIST)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder()
.location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build())
.build()).build()).build()).build();
private static final SdkField<Map<String, Map<String, String>>> MAP_OF_ENUM_TO_MAP_OF_STRING_TO_ENUM_FIELD = SdkField
.<Map<String, Map<String, String>>> builder(MarshallingType.MAP)
.memberName("MapOfEnumToMapOfStringToEnum")
.getter(getter(AllTypesResponse::mapOfEnumToMapOfStringToEnumAsStrings))
.setter(setter(Builder::mapOfEnumToMapOfStringToEnumWithStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MapOfEnumToMapOfStringToEnum")
.build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<Map<String, String>> builder(MarshallingType.MAP)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder()
.location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build())
.build()).build()).build()).build();
private static final SdkField<Instant> TIMESTAMP_MEMBER_FIELD = SdkField.<Instant> builder(MarshallingType.INSTANT)
.memberName("TimestampMember").getter(getter(AllTypesResponse::timestampMember))
.setter(setter(Builder::timestampMember))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TimestampMember").build()).build();
private static final SdkField<StructWithTimestamp> STRUCT_WITH_NESTED_TIMESTAMP_MEMBER_FIELD = SdkField
.<StructWithTimestamp> builder(MarshallingType.SDK_POJO)
.memberName("StructWithNestedTimestampMember")
.getter(getter(AllTypesResponse::structWithNestedTimestampMember))
.setter(setter(Builder::structWithNestedTimestampMember))
.constructor(StructWithTimestamp::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StructWithNestedTimestampMember")
.build()).build();
private static final SdkField<SdkBytes> BLOB_ARG_FIELD = SdkField.<SdkBytes> builder(MarshallingType.SDK_BYTES)
.memberName("BlobArg").getter(getter(AllTypesResponse::blobArg)).setter(setter(Builder::blobArg))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("BlobArg").build()).build();
private static final SdkField<StructWithNestedBlobType> STRUCT_WITH_NESTED_BLOB_FIELD = SdkField
.<StructWithNestedBlobType> builder(MarshallingType.SDK_POJO).memberName("StructWithNestedBlob")
.getter(getter(AllTypesResponse::structWithNestedBlob)).setter(setter(Builder::structWithNestedBlob))
.constructor(StructWithNestedBlobType::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StructWithNestedBlob").build())
.build();
private static final SdkField<Map<String, SdkBytes>> BLOB_MAP_FIELD = SdkField
.<Map<String, SdkBytes>> builder(MarshallingType.MAP)
.memberName("BlobMap")
.getter(getter(AllTypesResponse::blobMap))
.setter(setter(Builder::blobMap))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("BlobMap").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<SdkBytes> builder(MarshallingType.SDK_BYTES)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build()).build()).build();
private static final SdkField<List<SdkBytes>> LIST_OF_BLOBS_FIELD = SdkField
.<List<SdkBytes>> builder(MarshallingType.LIST)
.memberName("ListOfBlobs")
.getter(getter(AllTypesResponse::listOfBlobs))
.setter(setter(Builder::listOfBlobs))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ListOfBlobs").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<SdkBytes> builder(MarshallingType.SDK_BYTES)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField<RecursiveStructType> RECURSIVE_STRUCT_FIELD = SdkField
.<RecursiveStructType> builder(MarshallingType.SDK_POJO).memberName("RecursiveStruct")
.getter(getter(AllTypesResponse::recursiveStruct)).setter(setter(Builder::recursiveStruct))
.constructor(RecursiveStructType::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RecursiveStruct").build()).build();
private static final SdkField<BaseType> POLYMORPHIC_TYPE_WITH_SUB_TYPES_FIELD = SdkField
.<BaseType> builder(MarshallingType.SDK_POJO)
.memberName("PolymorphicTypeWithSubTypes")
.getter(getter(AllTypesResponse::polymorphicTypeWithSubTypes))
.setter(setter(Builder::polymorphicTypeWithSubTypes))
.constructor(BaseType::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("PolymorphicTypeWithSubTypes")
.build()).build();
private static final SdkField<SubTypeOne> POLYMORPHIC_TYPE_WITHOUT_SUB_TYPES_FIELD = SdkField
.<SubTypeOne> builder(MarshallingType.SDK_POJO)
.memberName("PolymorphicTypeWithoutSubTypes")
.getter(getter(AllTypesResponse::polymorphicTypeWithoutSubTypes))
.setter(setter(Builder::polymorphicTypeWithoutSubTypes))
.constructor(SubTypeOne::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("PolymorphicTypeWithoutSubTypes")
.build()).build();
private static final SdkField<String> ENUM_TYPE_FIELD = SdkField.<String> builder(MarshallingType.STRING)
.memberName("EnumType").getter(getter(AllTypesResponse::enumTypeAsString)).setter(setter(Builder::enumType))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EnumType").build()).build();
private static final SdkField<Underscore_Name_Type> UNDERSCORE_NAME_TYPE_FIELD = SdkField
.<Underscore_Name_Type> builder(MarshallingType.SDK_POJO).memberName("Underscore_Name_Type")
.getter(getter(AllTypesResponse::underscore_Name_Type)).setter(setter(Builder::underscore_Name_Type))
.constructor(Underscore_Name_Type::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Underscore_Name_Type").build())
.build();
private static final SdkField<Document> MY_DOCUMENT_FIELD = SdkField.<Document> builder(MarshallingType.DOCUMENT)
.memberName("MyDocument").getter(getter(AllTypesResponse::myDocument)).setter(setter(Builder::myDocument))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MyDocument").build()).build();
private static final SdkField<AllTypesUnionStructure> ALL_TYPES_UNION_STRUCTURE_FIELD = SdkField
.<AllTypesUnionStructure> builder(MarshallingType.SDK_POJO).memberName("AllTypesUnionStructure")
.getter(getter(AllTypesResponse::allTypesUnionStructure)).setter(setter(Builder::allTypesUnionStructure))
.constructor(AllTypesUnionStructure::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AllTypesUnionStructure").build())
.build();
private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(STRING_MEMBER_FIELD,
INTEGER_MEMBER_FIELD, BOOLEAN_MEMBER_FIELD, FLOAT_MEMBER_FIELD, DOUBLE_MEMBER_FIELD, LONG_MEMBER_FIELD,
SHORT_MEMBER_FIELD, SIMPLE_LIST_FIELD, LIST_OF_ENUMS_FIELD, LIST_OF_MAPS_FIELD, LIST_OF_STRUCTS_FIELD,
LIST_OF_MAP_OF_ENUM_TO_STRING_FIELD, LIST_OF_MAP_OF_STRING_TO_STRUCT_FIELD, MAP_OF_STRING_TO_INTEGER_LIST_FIELD,
MAP_OF_STRING_TO_STRING_FIELD, MAP_OF_STRING_TO_SIMPLE_STRUCT_FIELD, MAP_OF_ENUM_TO_ENUM_FIELD,
MAP_OF_ENUM_TO_STRING_FIELD, MAP_OF_STRING_TO_ENUM_FIELD, MAP_OF_ENUM_TO_SIMPLE_STRUCT_FIELD,
MAP_OF_ENUM_TO_LIST_OF_ENUMS_FIELD, MAP_OF_ENUM_TO_MAP_OF_STRING_TO_ENUM_FIELD, TIMESTAMP_MEMBER_FIELD,
STRUCT_WITH_NESTED_TIMESTAMP_MEMBER_FIELD, BLOB_ARG_FIELD, STRUCT_WITH_NESTED_BLOB_FIELD, BLOB_MAP_FIELD,
LIST_OF_BLOBS_FIELD, RECURSIVE_STRUCT_FIELD, POLYMORPHIC_TYPE_WITH_SUB_TYPES_FIELD,
POLYMORPHIC_TYPE_WITHOUT_SUB_TYPES_FIELD, ENUM_TYPE_FIELD, UNDERSCORE_NAME_TYPE_FIELD, MY_DOCUMENT_FIELD,
ALL_TYPES_UNION_STRUCTURE_FIELD));
private final String stringMember;
private final Integer integerMember;
private final Boolean booleanMember;
private final Float floatMember;
private final Double doubleMember;
private final Long longMember;
private final Short shortMember;
private final List<String> simpleList;
private final List<String> listOfEnums;
private final List<Map<String, String>> listOfMaps;
private final List<SimpleStruct> listOfStructs;
private final List<Map<String, String>> listOfMapOfEnumToString;
private final List<Map<String, SimpleStruct>> listOfMapOfStringToStruct;
private final Map<String, List<Integer>> mapOfStringToIntegerList;
private final Map<String, String> mapOfStringToString;
private final Map<String, SimpleStruct> mapOfStringToSimpleStruct;
private final Map<String, String> mapOfEnumToEnum;
private final Map<String, String> mapOfEnumToString;
private final Map<String, String> mapOfStringToEnum;
private final Map<String, SimpleStruct> mapOfEnumToSimpleStruct;
private final Map<String, List<String>> mapOfEnumToListOfEnums;
private final Map<String, Map<String, String>> mapOfEnumToMapOfStringToEnum;
private final Instant timestampMember;
private final StructWithTimestamp structWithNestedTimestampMember;
private final SdkBytes blobArg;
private final StructWithNestedBlobType structWithNestedBlob;
private final Map<String, SdkBytes> blobMap;
private final List<SdkBytes> listOfBlobs;
private final RecursiveStructType recursiveStruct;
private final BaseType polymorphicTypeWithSubTypes;
private final SubTypeOne polymorphicTypeWithoutSubTypes;
private final String enumType;
private final Underscore_Name_Type underscore_Name_Type;
private final Document myDocument;
private final AllTypesUnionStructure allTypesUnionStructure;
private AllTypesResponse(BuilderImpl builder) {
super(builder);
this.stringMember = builder.stringMember;
this.integerMember = builder.integerMember;
this.booleanMember = builder.booleanMember;
this.floatMember = builder.floatMember;
this.doubleMember = builder.doubleMember;
this.longMember = builder.longMember;
this.shortMember = builder.shortMember;
this.simpleList = builder.simpleList;
this.listOfEnums = builder.listOfEnums;
this.listOfMaps = builder.listOfMaps;
this.listOfStructs = builder.listOfStructs;
this.listOfMapOfEnumToString = builder.listOfMapOfEnumToString;
this.listOfMapOfStringToStruct = builder.listOfMapOfStringToStruct;
this.mapOfStringToIntegerList = builder.mapOfStringToIntegerList;
this.mapOfStringToString = builder.mapOfStringToString;
this.mapOfStringToSimpleStruct = builder.mapOfStringToSimpleStruct;
this.mapOfEnumToEnum = builder.mapOfEnumToEnum;
this.mapOfEnumToString = builder.mapOfEnumToString;
this.mapOfStringToEnum = builder.mapOfStringToEnum;
this.mapOfEnumToSimpleStruct = builder.mapOfEnumToSimpleStruct;
this.mapOfEnumToListOfEnums = builder.mapOfEnumToListOfEnums;
this.mapOfEnumToMapOfStringToEnum = builder.mapOfEnumToMapOfStringToEnum;
this.timestampMember = builder.timestampMember;
this.structWithNestedTimestampMember = builder.structWithNestedTimestampMember;
this.blobArg = builder.blobArg;
this.structWithNestedBlob = builder.structWithNestedBlob;
this.blobMap = builder.blobMap;
this.listOfBlobs = builder.listOfBlobs;
this.recursiveStruct = builder.recursiveStruct;
this.polymorphicTypeWithSubTypes = builder.polymorphicTypeWithSubTypes;
this.polymorphicTypeWithoutSubTypes = builder.polymorphicTypeWithoutSubTypes;
this.enumType = builder.enumType;
this.underscore_Name_Type = builder.underscore_Name_Type;
this.myDocument = builder.myDocument;
this.allTypesUnionStructure = builder.allTypesUnionStructure;
}
/**
* Returns the value of the StringMember property for this object.
*
* @return The value of the StringMember property for this object.
*/
public final String stringMember() {
return stringMember;
}
/**
* Returns the value of the IntegerMember property for this object.
*
* @return The value of the IntegerMember property for this object.
*/
public final Integer integerMember() {
return integerMember;
}
/**
* Returns the value of the BooleanMember property for this object.
*
* @return The value of the BooleanMember property for this object.
*/
public final Boolean booleanMember() {
return booleanMember;
}
/**
* Returns the value of the FloatMember property for this object.
*
* @return The value of the FloatMember property for this object.
*/
public final Float floatMember() {
return floatMember;
}
/**
* Returns the value of the DoubleMember property for this object.
*
* @return The value of the DoubleMember property for this object.
*/
public final Double doubleMember() {
return doubleMember;
}
/**
* Returns the value of the LongMember property for this object.
*
* @return The value of the LongMember property for this object.
*/
public final Long longMember() {
return longMember;
}
/**
* Returns the value of the ShortMember property for this object.
*
* @return The value of the ShortMember property for this object.
*/
public final Short shortMember() {
return shortMember;
}
/**
* For responses, this returns true if the service returned a value for the SimpleList property. This DOES NOT check
* that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is
* useful because the SDK will never return a null collection or map, but you may need to differentiate between the
* service returning nothing (or null) and the service returning an empty collection or map. For requests, this
* returns true if a value for the property was specified in the request builder, and false if a value was not
* specified.
*/
public final boolean hasSimpleList() {
return simpleList != null && !(simpleList instanceof SdkAutoConstructList);
}
/**
* Returns the value of the SimpleList property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasSimpleList} method.
* </p>
*
* @return The value of the SimpleList property for this object.
*/
public final List<String> simpleList() {
return simpleList;
}
/**
* Returns the value of the ListOfEnums property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasListOfEnums} method.
* </p>
*
* @return The value of the ListOfEnums property for this object.
*/
public final List<EnumType> listOfEnums() {
return ListOfEnumsCopier.copyStringToEnum(listOfEnums);
}
/**
* For responses, this returns true if the service returned a value for the ListOfEnums property. This DOES NOT
* check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property).
* This is useful because the SDK will never return a null collection or map, but you may need to differentiate
* between the service returning nothing (or null) and the service returning an empty collection or map. For
* requests, this returns true if a value for the property was specified in the request builder, and false if a
* value was not specified.
*/
public final boolean hasListOfEnums() {
return listOfEnums != null && !(listOfEnums instanceof SdkAutoConstructList);
}
/**
* Returns the value of the ListOfEnums property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasListOfEnums} method.
* </p>
*
* @return The value of the ListOfEnums property for this object.
*/
public final List<String> listOfEnumsAsStrings() {
return listOfEnums;
}
/**
* For responses, this returns true if the service returned a value for the ListOfMaps property. This DOES NOT check
* that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is
* useful because the SDK will never return a null collection or map, but you may need to differentiate between the
* service returning nothing (or null) and the service returning an empty collection or map. For requests, this
* returns true if a value for the property was specified in the request builder, and false if a value was not
* specified.
*/
public final boolean hasListOfMaps() {
return listOfMaps != null && !(listOfMaps instanceof SdkAutoConstructList);
}
/**
* Returns the value of the ListOfMaps property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasListOfMaps} method.
* </p>
*
* @return The value of the ListOfMaps property for this object.
*/
public final List<Map<String, String>> listOfMaps() {
return listOfMaps;
}
/**
* For responses, this returns true if the service returned a value for the ListOfStructs property. This DOES NOT
* check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property).
* This is useful because the SDK will never return a null collection or map, but you may need to differentiate
* between the service returning nothing (or null) and the service returning an empty collection or map. For
* requests, this returns true if a value for the property was specified in the request builder, and false if a
* value was not specified.
*/
public final boolean hasListOfStructs() {
return listOfStructs != null && !(listOfStructs instanceof SdkAutoConstructList);
}
/**
* Returns the value of the ListOfStructs property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasListOfStructs} method.
* </p>
*
* @return The value of the ListOfStructs property for this object.
*/
public final List<SimpleStruct> listOfStructs() {
return listOfStructs;
}
/**
* Returns the value of the ListOfMapOfEnumToString property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasListOfMapOfEnumToString} method.
* </p>
*
* @return The value of the ListOfMapOfEnumToString property for this object.
*/
public final List<Map<EnumType, String>> listOfMapOfEnumToString() {
return ListOfMapOfEnumToStringCopier.copyStringToEnum(listOfMapOfEnumToString);
}
/**
* For responses, this returns true if the service returned a value for the ListOfMapOfEnumToString property. This
* DOES NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the
* property). This is useful because the SDK will never return a null collection or map, but you may need to
* differentiate between the service returning nothing (or null) and the service returning an empty collection or
* map. For requests, this returns true if a value for the property was specified in the request builder, and false
* if a value was not specified.
*/
public final boolean hasListOfMapOfEnumToString() {
return listOfMapOfEnumToString != null && !(listOfMapOfEnumToString instanceof SdkAutoConstructList);
}
/**
* Returns the value of the ListOfMapOfEnumToString property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasListOfMapOfEnumToString} method.
* </p>
*
* @return The value of the ListOfMapOfEnumToString property for this object.
*/
public final List<Map<String, String>> listOfMapOfEnumToStringAsStrings() {
return listOfMapOfEnumToString;
}
/**
* For responses, this returns true if the service returned a value for the ListOfMapOfStringToStruct property. This
* DOES NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the
* property). This is useful because the SDK will never return a null collection or map, but you may need to
* differentiate between the service returning nothing (or null) and the service returning an empty collection or
* map. For requests, this returns true if a value for the property was specified in the request builder, and false
* if a value was not specified.
*/
public final boolean hasListOfMapOfStringToStruct() {
return listOfMapOfStringToStruct != null && !(listOfMapOfStringToStruct instanceof SdkAutoConstructList);
}
/**
* Returns the value of the ListOfMapOfStringToStruct property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasListOfMapOfStringToStruct} method.
* </p>
*
* @return The value of the ListOfMapOfStringToStruct property for this object.
*/
public final List<Map<String, SimpleStruct>> listOfMapOfStringToStruct() {
return listOfMapOfStringToStruct;
}
/**
* For responses, this returns true if the service returned a value for the MapOfStringToIntegerList property. This
* DOES NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the
* property). This is useful because the SDK will never return a null collection or map, but you may need to
* differentiate between the service returning nothing (or null) and the service returning an empty collection or
* map. For requests, this returns true if a value for the property was specified in the request builder, and false
* if a value was not specified.
*/
public final boolean hasMapOfStringToIntegerList() {
return mapOfStringToIntegerList != null && !(mapOfStringToIntegerList instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the MapOfStringToIntegerList property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasMapOfStringToIntegerList} method.
* </p>
*
* @return The value of the MapOfStringToIntegerList property for this object.
*/
public final Map<String, List<Integer>> mapOfStringToIntegerList() {
return mapOfStringToIntegerList;
}
/**
* For responses, this returns true if the service returned a value for the MapOfStringToString property. This DOES
* NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property).
* This is useful because the SDK will never return a null collection or map, but you may need to differentiate
* between the service returning nothing (or null) and the service returning an empty collection or map. For
* requests, this returns true if a value for the property was specified in the request builder, and false if a
* value was not specified.
*/
public final boolean hasMapOfStringToString() {
return mapOfStringToString != null && !(mapOfStringToString instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the MapOfStringToString property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasMapOfStringToString} method.
* </p>
*
* @return The value of the MapOfStringToString property for this object.
*/
public final Map<String, String> mapOfStringToString() {
return mapOfStringToString;
}
/**
* For responses, this returns true if the service returned a value for the MapOfStringToSimpleStruct property. This
* DOES NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the
* property). This is useful because the SDK will never return a null collection or map, but you may need to
* differentiate between the service returning nothing (or null) and the service returning an empty collection or
* map. For requests, this returns true if a value for the property was specified in the request builder, and false
* if a value was not specified.
*/
public final boolean hasMapOfStringToSimpleStruct() {
return mapOfStringToSimpleStruct != null && !(mapOfStringToSimpleStruct instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the MapOfStringToSimpleStruct property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasMapOfStringToSimpleStruct} method.
* </p>
*
* @return The value of the MapOfStringToSimpleStruct property for this object.
*/
public final Map<String, SimpleStruct> mapOfStringToSimpleStruct() {
return mapOfStringToSimpleStruct;
}
/**
* Returns the value of the MapOfEnumToEnum property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasMapOfEnumToEnum} method.
* </p>
*
* @return The value of the MapOfEnumToEnum property for this object.
*/
public final Map<EnumType, EnumType> mapOfEnumToEnum() {
return MapOfEnumToEnumCopier.copyStringToEnum(mapOfEnumToEnum);
}
/**
* For responses, this returns true if the service returned a value for the MapOfEnumToEnum property. This DOES NOT
* check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property).
* This is useful because the SDK will never return a null collection or map, but you may need to differentiate
* between the service returning nothing (or null) and the service returning an empty collection or map. For
* requests, this returns true if a value for the property was specified in the request builder, and false if a
* value was not specified.
*/
public final boolean hasMapOfEnumToEnum() {
return mapOfEnumToEnum != null && !(mapOfEnumToEnum instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the MapOfEnumToEnum property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasMapOfEnumToEnum} method.
* </p>
*
* @return The value of the MapOfEnumToEnum property for this object.
*/
public final Map<String, String> mapOfEnumToEnumAsStrings() {
return mapOfEnumToEnum;
}
/**
* Returns the value of the MapOfEnumToString property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasMapOfEnumToString} method.
* </p>
*
* @return The value of the MapOfEnumToString property for this object.
*/
public final Map<EnumType, String> mapOfEnumToString() {
return MapOfEnumToStringCopier.copyStringToEnum(mapOfEnumToString);
}
/**
* For responses, this returns true if the service returned a value for the MapOfEnumToString property. This DOES
* NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property).
* This is useful because the SDK will never return a null collection or map, but you may need to differentiate
* between the service returning nothing (or null) and the service returning an empty collection or map. For
* requests, this returns true if a value for the property was specified in the request builder, and false if a
* value was not specified.
*/
public final boolean hasMapOfEnumToString() {
return mapOfEnumToString != null && !(mapOfEnumToString instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the MapOfEnumToString property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasMapOfEnumToString} method.
* </p>
*
* @return The value of the MapOfEnumToString property for this object.
*/
public final Map<String, String> mapOfEnumToStringAsStrings() {
return mapOfEnumToString;
}
/**
* Returns the value of the MapOfStringToEnum property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasMapOfStringToEnum} method.
* </p>
*
* @return The value of the MapOfStringToEnum property for this object.
*/
public final Map<String, EnumType> mapOfStringToEnum() {
return MapOfStringToEnumCopier.copyStringToEnum(mapOfStringToEnum);
}
/**
* For responses, this returns true if the service returned a value for the MapOfStringToEnum property. This DOES
* NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property).
* This is useful because the SDK will never return a null collection or map, but you may need to differentiate
* between the service returning nothing (or null) and the service returning an empty collection or map. For
* requests, this returns true if a value for the property was specified in the request builder, and false if a
* value was not specified.
*/
public final boolean hasMapOfStringToEnum() {
return mapOfStringToEnum != null && !(mapOfStringToEnum instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the MapOfStringToEnum property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasMapOfStringToEnum} method.
* </p>
*
* @return The value of the MapOfStringToEnum property for this object.
*/
public final Map<String, String> mapOfStringToEnumAsStrings() {
return mapOfStringToEnum;
}
/**
* Returns the value of the MapOfEnumToSimpleStruct property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasMapOfEnumToSimpleStruct} method.
* </p>
*
* @return The value of the MapOfEnumToSimpleStruct property for this object.
*/
public final Map<EnumType, SimpleStruct> mapOfEnumToSimpleStruct() {
return MapOfEnumToSimpleStructCopier.copyStringToEnum(mapOfEnumToSimpleStruct);
}
/**
* For responses, this returns true if the service returned a value for the MapOfEnumToSimpleStruct property. This
* DOES NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the
* property). This is useful because the SDK will never return a null collection or map, but you may need to
* differentiate between the service returning nothing (or null) and the service returning an empty collection or
* map. For requests, this returns true if a value for the property was specified in the request builder, and false
* if a value was not specified.
*/
public final boolean hasMapOfEnumToSimpleStruct() {
return mapOfEnumToSimpleStruct != null && !(mapOfEnumToSimpleStruct instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the MapOfEnumToSimpleStruct property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasMapOfEnumToSimpleStruct} method.
* </p>
*
* @return The value of the MapOfEnumToSimpleStruct property for this object.
*/
public final Map<String, SimpleStruct> mapOfEnumToSimpleStructAsStrings() {
return mapOfEnumToSimpleStruct;
}
/**
* Returns the value of the MapOfEnumToListOfEnums property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasMapOfEnumToListOfEnums} method.
* </p>
*
* @return The value of the MapOfEnumToListOfEnums property for this object.
*/
public final Map<EnumType, List<EnumType>> mapOfEnumToListOfEnums() {
return MapOfEnumToListOfEnumsCopier.copyStringToEnum(mapOfEnumToListOfEnums);
}
/**
* For responses, this returns true if the service returned a value for the MapOfEnumToListOfEnums property. This
* DOES NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the
* property). This is useful because the SDK will never return a null collection or map, but you may need to
* differentiate between the service returning nothing (or null) and the service returning an empty collection or
* map. For requests, this returns true if a value for the property was specified in the request builder, and false
* if a value was not specified.
*/
public final boolean hasMapOfEnumToListOfEnums() {
return mapOfEnumToListOfEnums != null && !(mapOfEnumToListOfEnums instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the MapOfEnumToListOfEnums property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasMapOfEnumToListOfEnums} method.
* </p>
*
* @return The value of the MapOfEnumToListOfEnums property for this object.
*/
public final Map<String, List<String>> mapOfEnumToListOfEnumsAsStrings() {
return mapOfEnumToListOfEnums;
}
/**
* Returns the value of the MapOfEnumToMapOfStringToEnum property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasMapOfEnumToMapOfStringToEnum} method.
* </p>
*
* @return The value of the MapOfEnumToMapOfStringToEnum property for this object.
*/
public final Map<EnumType, Map<String, EnumType>> mapOfEnumToMapOfStringToEnum() {
return MapOfEnumToMapOfStringToEnumCopier.copyStringToEnum(mapOfEnumToMapOfStringToEnum);
}
/**
* For responses, this returns true if the service returned a value for the MapOfEnumToMapOfStringToEnum property.
* This DOES NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the
* property). This is useful because the SDK will never return a null collection or map, but you may need to
* differentiate between the service returning nothing (or null) and the service returning an empty collection or
* map. For requests, this returns true if a value for the property was specified in the request builder, and false
* if a value was not specified.
*/
public final boolean hasMapOfEnumToMapOfStringToEnum() {
return mapOfEnumToMapOfStringToEnum != null && !(mapOfEnumToMapOfStringToEnum instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the MapOfEnumToMapOfStringToEnum property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasMapOfEnumToMapOfStringToEnum} method.
* </p>
*
* @return The value of the MapOfEnumToMapOfStringToEnum property for this object.
*/
public final Map<String, Map<String, String>> mapOfEnumToMapOfStringToEnumAsStrings() {
return mapOfEnumToMapOfStringToEnum;
}
/**
* Returns the value of the TimestampMember property for this object.
*
* @return The value of the TimestampMember property for this object.
*/
public final Instant timestampMember() {
return timestampMember;
}
/**
* Returns the value of the StructWithNestedTimestampMember property for this object.
*
* @return The value of the StructWithNestedTimestampMember property for this object.
*/
public final StructWithTimestamp structWithNestedTimestampMember() {
return structWithNestedTimestampMember;
}
/**
* Returns the value of the BlobArg property for this object.
*
* @return The value of the BlobArg property for this object.
*/
public final SdkBytes blobArg() {
return blobArg;
}
/**
* Returns the value of the StructWithNestedBlob property for this object.
*
* @return The value of the StructWithNestedBlob property for this object.
*/
public final StructWithNestedBlobType structWithNestedBlob() {
return structWithNestedBlob;
}
/**
* For responses, this returns true if the service returned a value for the BlobMap property. This DOES NOT check
* that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is
* useful because the SDK will never return a null collection or map, but you may need to differentiate between the
* service returning nothing (or null) and the service returning an empty collection or map. For requests, this
* returns true if a value for the property was specified in the request builder, and false if a value was not
* specified.
*/
public final boolean hasBlobMap() {
return blobMap != null && !(blobMap instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the BlobMap property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasBlobMap} method.
* </p>
*
* @return The value of the BlobMap property for this object.
*/
public final Map<String, SdkBytes> blobMap() {
return blobMap;
}
/**
* For responses, this returns true if the service returned a value for the ListOfBlobs property. This DOES NOT
* check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property).
* This is useful because the SDK will never return a null collection or map, but you may need to differentiate
* between the service returning nothing (or null) and the service returning an empty collection or map. For
* requests, this returns true if a value for the property was specified in the request builder, and false if a
* value was not specified.
*/
public final boolean hasListOfBlobs() {
return listOfBlobs != null && !(listOfBlobs instanceof SdkAutoConstructList);
}
/**
* Returns the value of the ListOfBlobs property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasListOfBlobs} method.
* </p>
*
* @return The value of the ListOfBlobs property for this object.
*/
public final List<SdkBytes> listOfBlobs() {
return listOfBlobs;
}
/**
* Returns the value of the RecursiveStruct property for this object.
*
* @return The value of the RecursiveStruct property for this object.
*/
public final RecursiveStructType recursiveStruct() {
return recursiveStruct;
}
/**
* Returns the value of the PolymorphicTypeWithSubTypes property for this object.
*
* @return The value of the PolymorphicTypeWithSubTypes property for this object.
*/
public final BaseType polymorphicTypeWithSubTypes() {
return polymorphicTypeWithSubTypes;
}
/**
* Returns the value of the PolymorphicTypeWithoutSubTypes property for this object.
*
* @return The value of the PolymorphicTypeWithoutSubTypes property for this object.
*/
public final SubTypeOne polymorphicTypeWithoutSubTypes() {
return polymorphicTypeWithoutSubTypes;
}
/**
* Returns the value of the EnumType property for this object.
* <p>
* If the service returns an enum value that is not available in the current SDK version, {@link #enumType} will
* return {@link EnumType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #enumTypeAsString}.
* </p>
*
* @return The value of the EnumType property for this object.
* @see EnumType
*/
public final EnumType enumType() {
return EnumType.fromValue(enumType);
}
/**
* Returns the value of the EnumType property for this object.
* <p>
* If the service returns an enum value that is not available in the current SDK version, {@link #enumType} will
* return {@link EnumType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #enumTypeAsString}.
* </p>
*
* @return The value of the EnumType property for this object.
* @see EnumType
*/
public final String enumTypeAsString() {
return enumType;
}
/**
* Returns the value of the Underscore_Name_Type property for this object.
*
* @return The value of the Underscore_Name_Type property for this object.
*/
public final Underscore_Name_Type underscore_Name_Type() {
return underscore_Name_Type;
}
/**
* Returns the value of the MyDocument property for this object.
*
* @return The value of the MyDocument property for this object.
*/
public final Document myDocument() {
return myDocument;
}
/**
* Returns the value of the AllTypesUnionStructure property for this object.
*
* @return The value of the AllTypesUnionStructure property for this object.
*/
public final AllTypesUnionStructure allTypesUnionStructure() {
return allTypesUnionStructure;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class<? extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
hashCode = 31 * hashCode + Objects.hashCode(stringMember());
hashCode = 31 * hashCode + Objects.hashCode(integerMember());
hashCode = 31 * hashCode + Objects.hashCode(booleanMember());
hashCode = 31 * hashCode + Objects.hashCode(floatMember());
hashCode = 31 * hashCode + Objects.hashCode(doubleMember());
hashCode = 31 * hashCode + Objects.hashCode(longMember());
hashCode = 31 * hashCode + Objects.hashCode(shortMember());
hashCode = 31 * hashCode + Objects.hashCode(hasSimpleList() ? simpleList() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasListOfEnums() ? listOfEnumsAsStrings() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasListOfMaps() ? listOfMaps() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasListOfStructs() ? listOfStructs() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasListOfMapOfEnumToString() ? listOfMapOfEnumToStringAsStrings() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasListOfMapOfStringToStruct() ? listOfMapOfStringToStruct() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasMapOfStringToIntegerList() ? mapOfStringToIntegerList() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasMapOfStringToString() ? mapOfStringToString() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasMapOfStringToSimpleStruct() ? mapOfStringToSimpleStruct() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasMapOfEnumToEnum() ? mapOfEnumToEnumAsStrings() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasMapOfEnumToString() ? mapOfEnumToStringAsStrings() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasMapOfStringToEnum() ? mapOfStringToEnumAsStrings() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasMapOfEnumToSimpleStruct() ? mapOfEnumToSimpleStructAsStrings() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasMapOfEnumToListOfEnums() ? mapOfEnumToListOfEnumsAsStrings() : null);
hashCode = 31 * hashCode
+ Objects.hashCode(hasMapOfEnumToMapOfStringToEnum() ? mapOfEnumToMapOfStringToEnumAsStrings() : null);
hashCode = 31 * hashCode + Objects.hashCode(timestampMember());
hashCode = 31 * hashCode + Objects.hashCode(structWithNestedTimestampMember());
hashCode = 31 * hashCode + Objects.hashCode(blobArg());
hashCode = 31 * hashCode + Objects.hashCode(structWithNestedBlob());
hashCode = 31 * hashCode + Objects.hashCode(hasBlobMap() ? blobMap() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasListOfBlobs() ? listOfBlobs() : null);
hashCode = 31 * hashCode + Objects.hashCode(recursiveStruct());
hashCode = 31 * hashCode + Objects.hashCode(polymorphicTypeWithSubTypes());
hashCode = 31 * hashCode + Objects.hashCode(polymorphicTypeWithoutSubTypes());
hashCode = 31 * hashCode + Objects.hashCode(enumTypeAsString());
hashCode = 31 * hashCode + Objects.hashCode(underscore_Name_Type());
hashCode = 31 * hashCode + Objects.hashCode(myDocument());
hashCode = 31 * hashCode + Objects.hashCode(allTypesUnionStructure());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof AllTypesResponse)) {
return false;
}
AllTypesResponse other = (AllTypesResponse) obj;
return Objects.equals(stringMember(), other.stringMember()) && Objects.equals(integerMember(), other.integerMember())
&& Objects.equals(booleanMember(), other.booleanMember()) && Objects.equals(floatMember(), other.floatMember())
&& Objects.equals(doubleMember(), other.doubleMember()) && Objects.equals(longMember(), other.longMember())
&& Objects.equals(shortMember(), other.shortMember()) && hasSimpleList() == other.hasSimpleList()
&& Objects.equals(simpleList(), other.simpleList()) && hasListOfEnums() == other.hasListOfEnums()
&& Objects.equals(listOfEnumsAsStrings(), other.listOfEnumsAsStrings())
&& hasListOfMaps() == other.hasListOfMaps() && Objects.equals(listOfMaps(), other.listOfMaps())
&& hasListOfStructs() == other.hasListOfStructs() && Objects.equals(listOfStructs(), other.listOfStructs())
&& hasListOfMapOfEnumToString() == other.hasListOfMapOfEnumToString()
&& Objects.equals(listOfMapOfEnumToStringAsStrings(), other.listOfMapOfEnumToStringAsStrings())
&& hasListOfMapOfStringToStruct() == other.hasListOfMapOfStringToStruct()
&& Objects.equals(listOfMapOfStringToStruct(), other.listOfMapOfStringToStruct())
&& hasMapOfStringToIntegerList() == other.hasMapOfStringToIntegerList()
&& Objects.equals(mapOfStringToIntegerList(), other.mapOfStringToIntegerList())
&& hasMapOfStringToString() == other.hasMapOfStringToString()
&& Objects.equals(mapOfStringToString(), other.mapOfStringToString())
&& hasMapOfStringToSimpleStruct() == other.hasMapOfStringToSimpleStruct()
&& Objects.equals(mapOfStringToSimpleStruct(), other.mapOfStringToSimpleStruct())
&& hasMapOfEnumToEnum() == other.hasMapOfEnumToEnum()
&& Objects.equals(mapOfEnumToEnumAsStrings(), other.mapOfEnumToEnumAsStrings())
&& hasMapOfEnumToString() == other.hasMapOfEnumToString()
&& Objects.equals(mapOfEnumToStringAsStrings(), other.mapOfEnumToStringAsStrings())
&& hasMapOfStringToEnum() == other.hasMapOfStringToEnum()
&& Objects.equals(mapOfStringToEnumAsStrings(), other.mapOfStringToEnumAsStrings())
&& hasMapOfEnumToSimpleStruct() == other.hasMapOfEnumToSimpleStruct()
&& Objects.equals(mapOfEnumToSimpleStructAsStrings(), other.mapOfEnumToSimpleStructAsStrings())
&& hasMapOfEnumToListOfEnums() == other.hasMapOfEnumToListOfEnums()
&& Objects.equals(mapOfEnumToListOfEnumsAsStrings(), other.mapOfEnumToListOfEnumsAsStrings())
&& hasMapOfEnumToMapOfStringToEnum() == other.hasMapOfEnumToMapOfStringToEnum()
&& Objects.equals(mapOfEnumToMapOfStringToEnumAsStrings(), other.mapOfEnumToMapOfStringToEnumAsStrings())
&& Objects.equals(timestampMember(), other.timestampMember())
&& Objects.equals(structWithNestedTimestampMember(), other.structWithNestedTimestampMember())
&& Objects.equals(blobArg(), other.blobArg())
&& Objects.equals(structWithNestedBlob(), other.structWithNestedBlob()) && hasBlobMap() == other.hasBlobMap()
&& Objects.equals(blobMap(), other.blobMap()) && hasListOfBlobs() == other.hasListOfBlobs()
&& Objects.equals(listOfBlobs(), other.listOfBlobs())
&& Objects.equals(recursiveStruct(), other.recursiveStruct())
&& Objects.equals(polymorphicTypeWithSubTypes(), other.polymorphicTypeWithSubTypes())
&& Objects.equals(polymorphicTypeWithoutSubTypes(), other.polymorphicTypeWithoutSubTypes())
&& Objects.equals(enumTypeAsString(), other.enumTypeAsString())
&& Objects.equals(underscore_Name_Type(), other.underscore_Name_Type())
&& Objects.equals(myDocument(), other.myDocument())
&& Objects.equals(allTypesUnionStructure(), other.allTypesUnionStructure());
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString
.builder("AllTypesResponse")
.add("StringMember", stringMember())
.add("IntegerMember", integerMember())
.add("BooleanMember", booleanMember())
.add("FloatMember", floatMember())
.add("DoubleMember", doubleMember())
.add("LongMember", longMember())
.add("ShortMember", shortMember())
.add("SimpleList", hasSimpleList() ? simpleList() : null)
.add("ListOfEnums", hasListOfEnums() ? listOfEnumsAsStrings() : null)
.add("ListOfMaps", hasListOfMaps() ? listOfMaps() : null)
.add("ListOfStructs", hasListOfStructs() ? listOfStructs() : null)
.add("ListOfMapOfEnumToString", hasListOfMapOfEnumToString() ? listOfMapOfEnumToStringAsStrings() : null)
.add("ListOfMapOfStringToStruct", hasListOfMapOfStringToStruct() ? listOfMapOfStringToStruct() : null)
.add("MapOfStringToIntegerList", hasMapOfStringToIntegerList() ? mapOfStringToIntegerList() : null)
.add("MapOfStringToString", hasMapOfStringToString() ? mapOfStringToString() : null)
.add("MapOfStringToSimpleStruct", hasMapOfStringToSimpleStruct() ? mapOfStringToSimpleStruct() : null)
.add("MapOfEnumToEnum", hasMapOfEnumToEnum() ? mapOfEnumToEnumAsStrings() : null)
.add("MapOfEnumToString", hasMapOfEnumToString() ? mapOfEnumToStringAsStrings() : null)
.add("MapOfStringToEnum", hasMapOfStringToEnum() ? mapOfStringToEnumAsStrings() : null)
.add("MapOfEnumToSimpleStruct", hasMapOfEnumToSimpleStruct() ? mapOfEnumToSimpleStructAsStrings() : null)
.add("MapOfEnumToListOfEnums", hasMapOfEnumToListOfEnums() ? mapOfEnumToListOfEnumsAsStrings() : null)
.add("MapOfEnumToMapOfStringToEnum",
hasMapOfEnumToMapOfStringToEnum() ? mapOfEnumToMapOfStringToEnumAsStrings() : null)
.add("TimestampMember", timestampMember())
.add("StructWithNestedTimestampMember", structWithNestedTimestampMember()).add("BlobArg", blobArg())
.add("StructWithNestedBlob", structWithNestedBlob()).add("BlobMap", hasBlobMap() ? blobMap() : null)
.add("ListOfBlobs", hasListOfBlobs() ? listOfBlobs() : null).add("RecursiveStruct", recursiveStruct())
.add("PolymorphicTypeWithSubTypes", polymorphicTypeWithSubTypes())
.add("PolymorphicTypeWithoutSubTypes", polymorphicTypeWithoutSubTypes()).add("EnumType", enumTypeAsString())
.add("Underscore_Name_Type", underscore_Name_Type()).add("MyDocument", myDocument())
.add("AllTypesUnionStructure", allTypesUnionStructure()).build();
}
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
switch (fieldName) {
case "StringMember":
return Optional.ofNullable(clazz.cast(stringMember()));
case "IntegerMember":
return Optional.ofNullable(clazz.cast(integerMember()));
case "BooleanMember":
return Optional.ofNullable(clazz.cast(booleanMember()));
case "FloatMember":
return Optional.ofNullable(clazz.cast(floatMember()));
case "DoubleMember":
return Optional.ofNullable(clazz.cast(doubleMember()));
case "LongMember":
return Optional.ofNullable(clazz.cast(longMember()));
case "ShortMember":
return Optional.ofNullable(clazz.cast(shortMember()));
case "SimpleList":
return Optional.ofNullable(clazz.cast(simpleList()));
case "ListOfEnums":
return Optional.ofNullable(clazz.cast(listOfEnumsAsStrings()));
case "ListOfMaps":
return Optional.ofNullable(clazz.cast(listOfMaps()));
case "ListOfStructs":
return Optional.ofNullable(clazz.cast(listOfStructs()));
case "ListOfMapOfEnumToString":
return Optional.ofNullable(clazz.cast(listOfMapOfEnumToStringAsStrings()));
case "ListOfMapOfStringToStruct":
return Optional.ofNullable(clazz.cast(listOfMapOfStringToStruct()));
case "MapOfStringToIntegerList":
return Optional.ofNullable(clazz.cast(mapOfStringToIntegerList()));
case "MapOfStringToString":
return Optional.ofNullable(clazz.cast(mapOfStringToString()));
case "MapOfStringToSimpleStruct":
return Optional.ofNullable(clazz.cast(mapOfStringToSimpleStruct()));
case "MapOfEnumToEnum":
return Optional.ofNullable(clazz.cast(mapOfEnumToEnumAsStrings()));
case "MapOfEnumToString":
return Optional.ofNullable(clazz.cast(mapOfEnumToStringAsStrings()));
case "MapOfStringToEnum":
return Optional.ofNullable(clazz.cast(mapOfStringToEnumAsStrings()));
case "MapOfEnumToSimpleStruct":
return Optional.ofNullable(clazz.cast(mapOfEnumToSimpleStructAsStrings()));
case "MapOfEnumToListOfEnums":
return Optional.ofNullable(clazz.cast(mapOfEnumToListOfEnumsAsStrings()));
case "MapOfEnumToMapOfStringToEnum":
return Optional.ofNullable(clazz.cast(mapOfEnumToMapOfStringToEnumAsStrings()));
case "TimestampMember":
return Optional.ofNullable(clazz.cast(timestampMember()));
case "StructWithNestedTimestampMember":
return Optional.ofNullable(clazz.cast(structWithNestedTimestampMember()));
case "BlobArg":
return Optional.ofNullable(clazz.cast(blobArg()));
case "StructWithNestedBlob":
return Optional.ofNullable(clazz.cast(structWithNestedBlob()));
case "BlobMap":
return Optional.ofNullable(clazz.cast(blobMap()));
case "ListOfBlobs":
return Optional.ofNullable(clazz.cast(listOfBlobs()));
case "RecursiveStruct":
return Optional.ofNullable(clazz.cast(recursiveStruct()));
case "PolymorphicTypeWithSubTypes":
return Optional.ofNullable(clazz.cast(polymorphicTypeWithSubTypes()));
case "PolymorphicTypeWithoutSubTypes":
return Optional.ofNullable(clazz.cast(polymorphicTypeWithoutSubTypes()));
case "EnumType":
return Optional.ofNullable(clazz.cast(enumTypeAsString()));
case "Underscore_Name_Type":
return Optional.ofNullable(clazz.cast(underscore_Name_Type()));
case "MyDocument":
return Optional.ofNullable(clazz.cast(myDocument()));
case "AllTypesUnionStructure":
return Optional.ofNullable(clazz.cast(allTypesUnionStructure()));
default:
return Optional.empty();
}
}
@Override
public final List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
private static <T> Function<Object, T> getter(Function<AllTypesResponse, T> g) {
return obj -> g.apply((AllTypesResponse) obj);
}
private static <T> BiConsumer<Object, T> setter(BiConsumer<Builder, T> s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
public interface Builder extends JsonProtocolTestsResponse.Builder, SdkPojo, CopyableBuilder<Builder, AllTypesResponse> {
/**
* Sets the value of the StringMember property for this object.
*
* @param stringMember
* The new value for the StringMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder stringMember(String stringMember);
/**
* Sets the value of the IntegerMember property for this object.
*
* @param integerMember
* The new value for the IntegerMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder integerMember(Integer integerMember);
/**
* Sets the value of the BooleanMember property for this object.
*
* @param booleanMember
* The new value for the BooleanMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder booleanMember(Boolean booleanMember);
/**
* Sets the value of the FloatMember property for this object.
*
* @param floatMember
* The new value for the FloatMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder floatMember(Float floatMember);
/**
* Sets the value of the DoubleMember property for this object.
*
* @param doubleMember
* The new value for the DoubleMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder doubleMember(Double doubleMember);
/**
* Sets the value of the LongMember property for this object.
*
* @param longMember
* The new value for the LongMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder longMember(Long longMember);
/**
* Sets the value of the ShortMember property for this object.
*
* @param shortMember
* The new value for the ShortMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder shortMember(Short shortMember);
/**
* Sets the value of the SimpleList property for this object.
*
* @param simpleList
* The new value for the SimpleList property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder simpleList(Collection<String> simpleList);
/**
* Sets the value of the SimpleList property for this object.
*
* @param simpleList
* The new value for the SimpleList property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder simpleList(String... simpleList);
/**
* Sets the value of the ListOfEnums property for this object.
*
* @param listOfEnums
* The new value for the ListOfEnums property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfEnumsWithStrings(Collection<String> listOfEnums);
/**
* Sets the value of the ListOfEnums property for this object.
*
* @param listOfEnums
* The new value for the ListOfEnums property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfEnumsWithStrings(String... listOfEnums);
/**
* Sets the value of the ListOfEnums property for this object.
*
* @param listOfEnums
* The new value for the ListOfEnums property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfEnums(Collection<EnumType> listOfEnums);
/**
* Sets the value of the ListOfEnums property for this object.
*
* @param listOfEnums
* The new value for the ListOfEnums property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfEnums(EnumType... listOfEnums);
/**
* Sets the value of the ListOfMaps property for this object.
*
* @param listOfMaps
* The new value for the ListOfMaps property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfMaps(Collection<? extends Map<String, String>> listOfMaps);
/**
* Sets the value of the ListOfMaps property for this object.
*
* @param listOfMaps
* The new value for the ListOfMaps property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfMaps(Map<String, String>... listOfMaps);
/**
* Sets the value of the ListOfStructs property for this object.
*
* @param listOfStructs
* The new value for the ListOfStructs property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfStructs(Collection<SimpleStruct> listOfStructs);
/**
* Sets the value of the ListOfStructs property for this object.
*
* @param listOfStructs
* The new value for the ListOfStructs property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfStructs(SimpleStruct... listOfStructs);
/**
* Sets the value of the ListOfStructs property for this object.
*
* This is a convenience method that creates an instance of the
* {@link software.amazon.awssdk.services.jsonprotocoltests.model.SimpleStruct.Builder} avoiding the need to
* create one manually via
* {@link software.amazon.awssdk.services.jsonprotocoltests.model.SimpleStruct#builder()}.
*
* <p>
* When the {@link Consumer} completes,
* {@link software.amazon.awssdk.services.jsonprotocoltests.model.SimpleStruct.Builder#build()} is called
* immediately and its result is passed to {@link #listOfStructs(List<SimpleStruct>)}.
*
* @param listOfStructs
* a consumer that will call methods on
* {@link software.amazon.awssdk.services.jsonprotocoltests.model.SimpleStruct.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #listOfStructs(java.util.Collection<SimpleStruct>)
*/
Builder listOfStructs(Consumer<SimpleStruct.Builder>... listOfStructs);
/**
* Sets the value of the ListOfMapOfEnumToString property for this object.
*
* @param listOfMapOfEnumToString
* The new value for the ListOfMapOfEnumToString property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfMapOfEnumToStringWithStrings(Collection<? extends Map<String, String>> listOfMapOfEnumToString);
/**
* Sets the value of the ListOfMapOfEnumToString property for this object.
*
* @param listOfMapOfEnumToString
* The new value for the ListOfMapOfEnumToString property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfMapOfEnumToStringWithStrings(Map<String, String>... listOfMapOfEnumToString);
/**
* Sets the value of the ListOfMapOfStringToStruct property for this object.
*
* @param listOfMapOfStringToStruct
* The new value for the ListOfMapOfStringToStruct property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfMapOfStringToStruct(Collection<? extends Map<String, SimpleStruct>> listOfMapOfStringToStruct);
/**
* Sets the value of the ListOfMapOfStringToStruct property for this object.
*
* @param listOfMapOfStringToStruct
* The new value for the ListOfMapOfStringToStruct property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfMapOfStringToStruct(Map<String, SimpleStruct>... listOfMapOfStringToStruct);
/**
* Sets the value of the MapOfStringToIntegerList property for this object.
*
* @param mapOfStringToIntegerList
* The new value for the MapOfStringToIntegerList property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfStringToIntegerList(Map<String, ? extends Collection<Integer>> mapOfStringToIntegerList);
/**
* Sets the value of the MapOfStringToString property for this object.
*
* @param mapOfStringToString
* The new value for the MapOfStringToString property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfStringToString(Map<String, String> mapOfStringToString);
/**
* Sets the value of the MapOfStringToSimpleStruct property for this object.
*
* @param mapOfStringToSimpleStruct
* The new value for the MapOfStringToSimpleStruct property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfStringToSimpleStruct(Map<String, SimpleStruct> mapOfStringToSimpleStruct);
/**
* Sets the value of the MapOfEnumToEnum property for this object.
*
* @param mapOfEnumToEnum
* The new value for the MapOfEnumToEnum property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfEnumToEnumWithStrings(Map<String, String> mapOfEnumToEnum);
/**
* Sets the value of the MapOfEnumToEnum property for this object.
*
* @param mapOfEnumToEnum
* The new value for the MapOfEnumToEnum property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfEnumToEnum(Map<EnumType, EnumType> mapOfEnumToEnum);
/**
* Sets the value of the MapOfEnumToString property for this object.
*
* @param mapOfEnumToString
* The new value for the MapOfEnumToString property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfEnumToStringWithStrings(Map<String, String> mapOfEnumToString);
/**
* Sets the value of the MapOfEnumToString property for this object.
*
* @param mapOfEnumToString
* The new value for the MapOfEnumToString property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfEnumToString(Map<EnumType, String> mapOfEnumToString);
/**
* Sets the value of the MapOfStringToEnum property for this object.
*
* @param mapOfStringToEnum
* The new value for the MapOfStringToEnum property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfStringToEnumWithStrings(Map<String, String> mapOfStringToEnum);
/**
* Sets the value of the MapOfStringToEnum property for this object.
*
* @param mapOfStringToEnum
* The new value for the MapOfStringToEnum property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfStringToEnum(Map<String, EnumType> mapOfStringToEnum);
/**
* Sets the value of the MapOfEnumToSimpleStruct property for this object.
*
* @param mapOfEnumToSimpleStruct
* The new value for the MapOfEnumToSimpleStruct property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfEnumToSimpleStructWithStrings(Map<String, SimpleStruct> mapOfEnumToSimpleStruct);
/**
* Sets the value of the MapOfEnumToSimpleStruct property for this object.
*
* @param mapOfEnumToSimpleStruct
* The new value for the MapOfEnumToSimpleStruct property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfEnumToSimpleStruct(Map<EnumType, SimpleStruct> mapOfEnumToSimpleStruct);
/**
* Sets the value of the MapOfEnumToListOfEnums property for this object.
*
* @param mapOfEnumToListOfEnums
* The new value for the MapOfEnumToListOfEnums property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfEnumToListOfEnumsWithStrings(Map<String, ? extends Collection<String>> mapOfEnumToListOfEnums);
/**
* Sets the value of the MapOfEnumToListOfEnums property for this object.
*
* @param mapOfEnumToListOfEnums
* The new value for the MapOfEnumToListOfEnums property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfEnumToListOfEnums(Map<EnumType, ? extends Collection<EnumType>> mapOfEnumToListOfEnums);
/**
* Sets the value of the MapOfEnumToMapOfStringToEnum property for this object.
*
* @param mapOfEnumToMapOfStringToEnum
* The new value for the MapOfEnumToMapOfStringToEnum property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfEnumToMapOfStringToEnumWithStrings(Map<String, ? extends Map<String, String>> mapOfEnumToMapOfStringToEnum);
/**
* Sets the value of the MapOfEnumToMapOfStringToEnum property for this object.
*
* @param mapOfEnumToMapOfStringToEnum
* The new value for the MapOfEnumToMapOfStringToEnum property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfEnumToMapOfStringToEnum(Map<EnumType, ? extends Map<String, EnumType>> mapOfEnumToMapOfStringToEnum);
/**
* Sets the value of the TimestampMember property for this object.
*
* @param timestampMember
* The new value for the TimestampMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder timestampMember(Instant timestampMember);
/**
* Sets the value of the StructWithNestedTimestampMember property for this object.
*
* @param structWithNestedTimestampMember
* The new value for the StructWithNestedTimestampMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder structWithNestedTimestampMember(StructWithTimestamp structWithNestedTimestampMember);
/**
* Sets the value of the StructWithNestedTimestampMember property for this object.
*
* This is a convenience method that creates an instance of the {@link StructWithTimestamp.Builder} avoiding the
* need to create one manually via {@link StructWithTimestamp#builder()}.
*
* <p>
* When the {@link Consumer} completes, {@link StructWithTimestamp.Builder#build()} is called immediately and
* its result is passed to {@link #structWithNestedTimestampMember(StructWithTimestamp)}.
*
* @param structWithNestedTimestampMember
* a consumer that will call methods on {@link StructWithTimestamp.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #structWithNestedTimestampMember(StructWithTimestamp)
*/
default Builder structWithNestedTimestampMember(Consumer<StructWithTimestamp.Builder> structWithNestedTimestampMember) {
return structWithNestedTimestampMember(StructWithTimestamp.builder().applyMutation(structWithNestedTimestampMember)
.build());
}
/**
* Sets the value of the BlobArg property for this object.
*
* @param blobArg
* The new value for the BlobArg property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder blobArg(SdkBytes blobArg);
/**
* Sets the value of the StructWithNestedBlob property for this object.
*
* @param structWithNestedBlob
* The new value for the StructWithNestedBlob property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder structWithNestedBlob(StructWithNestedBlobType structWithNestedBlob);
/**
* Sets the value of the StructWithNestedBlob property for this object.
*
* This is a convenience method that creates an instance of the {@link StructWithNestedBlobType.Builder}
* avoiding the need to create one manually via {@link StructWithNestedBlobType#builder()}.
*
* <p>
* When the {@link Consumer} completes, {@link StructWithNestedBlobType.Builder#build()} is called immediately
* and its result is passed to {@link #structWithNestedBlob(StructWithNestedBlobType)}.
*
* @param structWithNestedBlob
* a consumer that will call methods on {@link StructWithNestedBlobType.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #structWithNestedBlob(StructWithNestedBlobType)
*/
default Builder structWithNestedBlob(Consumer<StructWithNestedBlobType.Builder> structWithNestedBlob) {
return structWithNestedBlob(StructWithNestedBlobType.builder().applyMutation(structWithNestedBlob).build());
}
/**
* Sets the value of the BlobMap property for this object.
*
* @param blobMap
* The new value for the BlobMap property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder blobMap(Map<String, SdkBytes> blobMap);
/**
* Sets the value of the ListOfBlobs property for this object.
*
* @param listOfBlobs
* The new value for the ListOfBlobs property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfBlobs(Collection<SdkBytes> listOfBlobs);
/**
* Sets the value of the ListOfBlobs property for this object.
*
* @param listOfBlobs
* The new value for the ListOfBlobs property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfBlobs(SdkBytes... listOfBlobs);
/**
* Sets the value of the RecursiveStruct property for this object.
*
* @param recursiveStruct
* The new value for the RecursiveStruct property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder recursiveStruct(RecursiveStructType recursiveStruct);
/**
* Sets the value of the RecursiveStruct property for this object.
*
* This is a convenience method that creates an instance of the {@link RecursiveStructType.Builder} avoiding the
* need to create one manually via {@link RecursiveStructType#builder()}.
*
* <p>
* When the {@link Consumer} completes, {@link RecursiveStructType.Builder#build()} is called immediately and
* its result is passed to {@link #recursiveStruct(RecursiveStructType)}.
*
* @param recursiveStruct
* a consumer that will call methods on {@link RecursiveStructType.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #recursiveStruct(RecursiveStructType)
*/
default Builder recursiveStruct(Consumer<RecursiveStructType.Builder> recursiveStruct) {
return recursiveStruct(RecursiveStructType.builder().applyMutation(recursiveStruct).build());
}
/**
* Sets the value of the PolymorphicTypeWithSubTypes property for this object.
*
* @param polymorphicTypeWithSubTypes
* The new value for the PolymorphicTypeWithSubTypes property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder polymorphicTypeWithSubTypes(BaseType polymorphicTypeWithSubTypes);
/**
* Sets the value of the PolymorphicTypeWithSubTypes property for this object.
*
* This is a convenience method that creates an instance of the {@link BaseType.Builder} avoiding the need to
* create one manually via {@link BaseType#builder()}.
*
* <p>
* When the {@link Consumer} completes, {@link BaseType.Builder#build()} is called immediately and its result is
* passed to {@link #polymorphicTypeWithSubTypes(BaseType)}.
*
* @param polymorphicTypeWithSubTypes
* a consumer that will call methods on {@link BaseType.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #polymorphicTypeWithSubTypes(BaseType)
*/
default Builder polymorphicTypeWithSubTypes(Consumer<BaseType.Builder> polymorphicTypeWithSubTypes) {
return polymorphicTypeWithSubTypes(BaseType.builder().applyMutation(polymorphicTypeWithSubTypes).build());
}
/**
* Sets the value of the PolymorphicTypeWithoutSubTypes property for this object.
*
* @param polymorphicTypeWithoutSubTypes
* The new value for the PolymorphicTypeWithoutSubTypes property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder polymorphicTypeWithoutSubTypes(SubTypeOne polymorphicTypeWithoutSubTypes);
/**
* Sets the value of the PolymorphicTypeWithoutSubTypes property for this object.
*
* This is a convenience method that creates an instance of the {@link SubTypeOne.Builder} avoiding the need to
* create one manually via {@link SubTypeOne#builder()}.
*
* <p>
* When the {@link Consumer} completes, {@link SubTypeOne.Builder#build()} is called immediately and its result
* is passed to {@link #polymorphicTypeWithoutSubTypes(SubTypeOne)}.
*
* @param polymorphicTypeWithoutSubTypes
* a consumer that will call methods on {@link SubTypeOne.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #polymorphicTypeWithoutSubTypes(SubTypeOne)
*/
default Builder polymorphicTypeWithoutSubTypes(Consumer<SubTypeOne.Builder> polymorphicTypeWithoutSubTypes) {
return polymorphicTypeWithoutSubTypes(SubTypeOne.builder().applyMutation(polymorphicTypeWithoutSubTypes).build());
}
/**
* Sets the value of the EnumType property for this object.
*
* @param enumType
* The new value for the EnumType property for this object.
* @see EnumType
* @return Returns a reference to this object so that method calls can be chained together.
* @see EnumType
*/
Builder enumType(String enumType);
/**
* Sets the value of the EnumType property for this object.
*
* @param enumType
* The new value for the EnumType property for this object.
* @see EnumType
* @return Returns a reference to this object so that method calls can be chained together.
* @see EnumType
*/
Builder enumType(EnumType enumType);
/**
* Sets the value of the Underscore_Name_Type property for this object.
*
* @param underscore_Name_Type
* The new value for the Underscore_Name_Type property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder underscore_Name_Type(Underscore_Name_Type underscore_Name_Type);
/**
* Sets the value of the Underscore_Name_Type property for this object.
*
* This is a convenience method that creates an instance of the {@link Underscore_Name_Type.Builder} avoiding
* the need to create one manually via {@link Underscore_Name_Type#builder()}.
*
* <p>
* When the {@link Consumer} completes, {@link Underscore_Name_Type.Builder#build()} is called immediately and
* its result is passed to {@link #underscore_Name_Type(Underscore_Name_Type)}.
*
* @param underscore_Name_Type
* a consumer that will call methods on {@link Underscore_Name_Type.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #underscore_Name_Type(Underscore_Name_Type)
*/
default Builder underscore_Name_Type(Consumer<Underscore_Name_Type.Builder> underscore_Name_Type) {
return underscore_Name_Type(Underscore_Name_Type.builder().applyMutation(underscore_Name_Type).build());
}
/**
* Sets the value of the MyDocument property for this object.
*
* @param myDocument
* The new value for the MyDocument property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder myDocument(Document myDocument);
/**
* Sets the value of the AllTypesUnionStructure property for this object.
*
* @param allTypesUnionStructure
* The new value for the AllTypesUnionStructure property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder allTypesUnionStructure(AllTypesUnionStructure allTypesUnionStructure);
/**
* Sets the value of the AllTypesUnionStructure property for this object.
*
* This is a convenience method that creates an instance of the {@link AllTypesUnionStructure.Builder} avoiding
* the need to create one manually via {@link AllTypesUnionStructure#builder()}.
*
* <p>
* When the {@link Consumer} completes, {@link AllTypesUnionStructure.Builder#build()} is called immediately and
* its result is passed to {@link #allTypesUnionStructure(AllTypesUnionStructure)}.
*
* @param allTypesUnionStructure
* a consumer that will call methods on {@link AllTypesUnionStructure.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #allTypesUnionStructure(AllTypesUnionStructure)
*/
default Builder allTypesUnionStructure(Consumer<AllTypesUnionStructure.Builder> allTypesUnionStructure) {
return allTypesUnionStructure(AllTypesUnionStructure.builder().applyMutation(allTypesUnionStructure).build());
}
}
static final class BuilderImpl extends JsonProtocolTestsResponse.BuilderImpl implements Builder {
private String stringMember;
private Integer integerMember;
private Boolean booleanMember;
private Float floatMember;
private Double doubleMember;
private Long longMember;
private Short shortMember;
private List<String> simpleList = DefaultSdkAutoConstructList.getInstance();
private List<String> listOfEnums = DefaultSdkAutoConstructList.getInstance();
private List<Map<String, String>> listOfMaps = DefaultSdkAutoConstructList.getInstance();
private List<SimpleStruct> listOfStructs = DefaultSdkAutoConstructList.getInstance();
private List<Map<String, String>> listOfMapOfEnumToString = DefaultSdkAutoConstructList.getInstance();
private List<Map<String, SimpleStruct>> listOfMapOfStringToStruct = DefaultSdkAutoConstructList.getInstance();
private Map<String, List<Integer>> mapOfStringToIntegerList = DefaultSdkAutoConstructMap.getInstance();
private Map<String, String> mapOfStringToString = DefaultSdkAutoConstructMap.getInstance();
private Map<String, SimpleStruct> mapOfStringToSimpleStruct = DefaultSdkAutoConstructMap.getInstance();
private Map<String, String> mapOfEnumToEnum = DefaultSdkAutoConstructMap.getInstance();
private Map<String, String> mapOfEnumToString = DefaultSdkAutoConstructMap.getInstance();
private Map<String, String> mapOfStringToEnum = DefaultSdkAutoConstructMap.getInstance();
private Map<String, SimpleStruct> mapOfEnumToSimpleStruct = DefaultSdkAutoConstructMap.getInstance();
private Map<String, List<String>> mapOfEnumToListOfEnums = DefaultSdkAutoConstructMap.getInstance();
private Map<String, Map<String, String>> mapOfEnumToMapOfStringToEnum = DefaultSdkAutoConstructMap.getInstance();
private Instant timestampMember;
private StructWithTimestamp structWithNestedTimestampMember;
private SdkBytes blobArg;
private StructWithNestedBlobType structWithNestedBlob;
private Map<String, SdkBytes> blobMap = DefaultSdkAutoConstructMap.getInstance();
private List<SdkBytes> listOfBlobs = DefaultSdkAutoConstructList.getInstance();
private RecursiveStructType recursiveStruct;
private BaseType polymorphicTypeWithSubTypes;
private SubTypeOne polymorphicTypeWithoutSubTypes;
private String enumType;
private Underscore_Name_Type underscore_Name_Type;
private Document myDocument;
private AllTypesUnionStructure allTypesUnionStructure;
private BuilderImpl() {
}
private BuilderImpl(AllTypesResponse model) {
super(model);
stringMember(model.stringMember);
integerMember(model.integerMember);
booleanMember(model.booleanMember);
floatMember(model.floatMember);
doubleMember(model.doubleMember);
longMember(model.longMember);
shortMember(model.shortMember);
simpleList(model.simpleList);
listOfEnumsWithStrings(model.listOfEnums);
listOfMaps(model.listOfMaps);
listOfStructs(model.listOfStructs);
listOfMapOfEnumToStringWithStrings(model.listOfMapOfEnumToString);
listOfMapOfStringToStruct(model.listOfMapOfStringToStruct);
mapOfStringToIntegerList(model.mapOfStringToIntegerList);
mapOfStringToString(model.mapOfStringToString);
mapOfStringToSimpleStruct(model.mapOfStringToSimpleStruct);
mapOfEnumToEnumWithStrings(model.mapOfEnumToEnum);
mapOfEnumToStringWithStrings(model.mapOfEnumToString);
mapOfStringToEnumWithStrings(model.mapOfStringToEnum);
mapOfEnumToSimpleStructWithStrings(model.mapOfEnumToSimpleStruct);
mapOfEnumToListOfEnumsWithStrings(model.mapOfEnumToListOfEnums);
mapOfEnumToMapOfStringToEnumWithStrings(model.mapOfEnumToMapOfStringToEnum);
timestampMember(model.timestampMember);
structWithNestedTimestampMember(model.structWithNestedTimestampMember);
blobArg(model.blobArg);
structWithNestedBlob(model.structWithNestedBlob);
blobMap(model.blobMap);
listOfBlobs(model.listOfBlobs);
recursiveStruct(model.recursiveStruct);
polymorphicTypeWithSubTypes(model.polymorphicTypeWithSubTypes);
polymorphicTypeWithoutSubTypes(model.polymorphicTypeWithoutSubTypes);
enumType(model.enumType);
underscore_Name_Type(model.underscore_Name_Type);
myDocument(model.myDocument);
allTypesUnionStructure(model.allTypesUnionStructure);
}
public final String getStringMember() {
return stringMember;
}
public final void setStringMember(String stringMember) {
this.stringMember = stringMember;
}
@Override
public final Builder stringMember(String stringMember) {
this.stringMember = stringMember;
return this;
}
public final Integer getIntegerMember() {
return integerMember;
}
public final void setIntegerMember(Integer integerMember) {
this.integerMember = integerMember;
}
@Override
public final Builder integerMember(Integer integerMember) {
this.integerMember = integerMember;
return this;
}
public final Boolean getBooleanMember() {
return booleanMember;
}
public final void setBooleanMember(Boolean booleanMember) {
this.booleanMember = booleanMember;
}
@Override
public final Builder booleanMember(Boolean booleanMember) {
this.booleanMember = booleanMember;
return this;
}
public final Float getFloatMember() {
return floatMember;
}
public final void setFloatMember(Float floatMember) {
this.floatMember = floatMember;
}
@Override
public final Builder floatMember(Float floatMember) {
this.floatMember = floatMember;
return this;
}
public final Double getDoubleMember() {
return doubleMember;
}
public final void setDoubleMember(Double doubleMember) {
this.doubleMember = doubleMember;
}
@Override
public final Builder doubleMember(Double doubleMember) {
this.doubleMember = doubleMember;
return this;
}
public final Long getLongMember() {
return longMember;
}
public final void setLongMember(Long longMember) {
this.longMember = longMember;
}
@Override
public final Builder longMember(Long longMember) {
this.longMember = longMember;
return this;
}
public final Short getShortMember() {
return shortMember;
}
public final void setShortMember(Short shortMember) {
this.shortMember = shortMember;
}
@Override
public final Builder shortMember(Short shortMember) {
this.shortMember = shortMember;
return this;
}
public final Collection<String> getSimpleList() {
if (simpleList instanceof SdkAutoConstructList) {
return null;
}
return simpleList;
}
public final void setSimpleList(Collection<String> simpleList) {
this.simpleList = ListOfStringsCopier.copy(simpleList);
}
@Override
public final Builder simpleList(Collection<String> simpleList) {
this.simpleList = ListOfStringsCopier.copy(simpleList);
return this;
}
@Override
@SafeVarargs
public final Builder simpleList(String... simpleList) {
simpleList(Arrays.asList(simpleList));
return this;
}
public final Collection<String> getListOfEnums() {
if (listOfEnums instanceof SdkAutoConstructList) {
return null;
}
return listOfEnums;
}
public final void setListOfEnums(Collection<String> listOfEnums) {
this.listOfEnums = ListOfEnumsCopier.copy(listOfEnums);
}
@Override
public final Builder listOfEnumsWithStrings(Collection<String> listOfEnums) {
this.listOfEnums = ListOfEnumsCopier.copy(listOfEnums);
return this;
}
@Override
@SafeVarargs
public final Builder listOfEnumsWithStrings(String... listOfEnums) {
listOfEnumsWithStrings(Arrays.asList(listOfEnums));
return this;
}
@Override
public final Builder listOfEnums(Collection<EnumType> listOfEnums) {
this.listOfEnums = ListOfEnumsCopier.copyEnumToString(listOfEnums);
return this;
}
@Override
@SafeVarargs
public final Builder listOfEnums(EnumType... listOfEnums) {
listOfEnums(Arrays.asList(listOfEnums));
return this;
}
public final Collection<? extends Map<String, String>> getListOfMaps() {
if (listOfMaps instanceof SdkAutoConstructList) {
return null;
}
return listOfMaps;
}
public final void setListOfMaps(Collection<? extends Map<String, String>> listOfMaps) {
this.listOfMaps = ListOfMapStringToStringCopier.copy(listOfMaps);
}
@Override
public final Builder listOfMaps(Collection<? extends Map<String, String>> listOfMaps) {
this.listOfMaps = ListOfMapStringToStringCopier.copy(listOfMaps);
return this;
}
@Override
@SafeVarargs
public final Builder listOfMaps(Map<String, String>... listOfMaps) {
listOfMaps(Arrays.asList(listOfMaps));
return this;
}
public final List<SimpleStruct.Builder> getListOfStructs() {
List<SimpleStruct.Builder> result = ListOfSimpleStructsCopier.copyToBuilder(this.listOfStructs);
if (result instanceof SdkAutoConstructList) {
return null;
}
return result;
}
public final void setListOfStructs(Collection<SimpleStruct.BuilderImpl> listOfStructs) {
this.listOfStructs = ListOfSimpleStructsCopier.copyFromBuilder(listOfStructs);
}
@Override
public final Builder listOfStructs(Collection<SimpleStruct> listOfStructs) {
this.listOfStructs = ListOfSimpleStructsCopier.copy(listOfStructs);
return this;
}
@Override
@SafeVarargs
public final Builder listOfStructs(SimpleStruct... listOfStructs) {
listOfStructs(Arrays.asList(listOfStructs));
return this;
}
@Override
@SafeVarargs
public final Builder listOfStructs(Consumer<SimpleStruct.Builder>... listOfStructs) {
listOfStructs(Stream.of(listOfStructs).map(c -> SimpleStruct.builder().applyMutation(c).build())
.collect(Collectors.toList()));
return this;
}
public final Collection<? extends Map<String, String>> getListOfMapOfEnumToString() {
if (listOfMapOfEnumToString instanceof SdkAutoConstructList) {
return null;
}
return listOfMapOfEnumToString;
}
public final void setListOfMapOfEnumToString(Collection<? extends Map<String, String>> listOfMapOfEnumToString) {
this.listOfMapOfEnumToString = ListOfMapOfEnumToStringCopier.copy(listOfMapOfEnumToString);
}
@Override
public final Builder listOfMapOfEnumToStringWithStrings(Collection<? extends Map<String, String>> listOfMapOfEnumToString) {
this.listOfMapOfEnumToString = ListOfMapOfEnumToStringCopier.copy(listOfMapOfEnumToString);
return this;
}
@Override
@SafeVarargs
public final Builder listOfMapOfEnumToStringWithStrings(Map<String, String>... listOfMapOfEnumToString) {
listOfMapOfEnumToStringWithStrings(Arrays.asList(listOfMapOfEnumToString));
return this;
}
public final List<Map<String, SimpleStruct.Builder>> getListOfMapOfStringToStruct() {
List<Map<String, SimpleStruct.Builder>> result = ListOfMapOfStringToStructCopier
.copyToBuilder(this.listOfMapOfStringToStruct);
if (result instanceof SdkAutoConstructList) {
return null;
}
return result;
}
public final void setListOfMapOfStringToStruct(
Collection<? extends Map<String, SimpleStruct.BuilderImpl>> listOfMapOfStringToStruct) {
this.listOfMapOfStringToStruct = ListOfMapOfStringToStructCopier.copyFromBuilder(listOfMapOfStringToStruct);
}
@Override
public final Builder listOfMapOfStringToStruct(Collection<? extends Map<String, SimpleStruct>> listOfMapOfStringToStruct) {
this.listOfMapOfStringToStruct = ListOfMapOfStringToStructCopier.copy(listOfMapOfStringToStruct);
return this;
}
@Override
@SafeVarargs
public final Builder listOfMapOfStringToStruct(Map<String, SimpleStruct>... listOfMapOfStringToStruct) {
listOfMapOfStringToStruct(Arrays.asList(listOfMapOfStringToStruct));
return this;
}
public final Map<String, ? extends Collection<Integer>> getMapOfStringToIntegerList() {
if (mapOfStringToIntegerList instanceof SdkAutoConstructMap) {
return null;
}
return mapOfStringToIntegerList;
}
public final void setMapOfStringToIntegerList(Map<String, ? extends Collection<Integer>> mapOfStringToIntegerList) {
this.mapOfStringToIntegerList = MapOfStringToIntegerListCopier.copy(mapOfStringToIntegerList);
}
@Override
public final Builder mapOfStringToIntegerList(Map<String, ? extends Collection<Integer>> mapOfStringToIntegerList) {
this.mapOfStringToIntegerList = MapOfStringToIntegerListCopier.copy(mapOfStringToIntegerList);
return this;
}
public final Map<String, String> getMapOfStringToString() {
if (mapOfStringToString instanceof SdkAutoConstructMap) {
return null;
}
return mapOfStringToString;
}
public final void setMapOfStringToString(Map<String, String> mapOfStringToString) {
this.mapOfStringToString = MapOfStringToStringCopier.copy(mapOfStringToString);
}
@Override
public final Builder mapOfStringToString(Map<String, String> mapOfStringToString) {
this.mapOfStringToString = MapOfStringToStringCopier.copy(mapOfStringToString);
return this;
}
public final Map<String, SimpleStruct.Builder> getMapOfStringToSimpleStruct() {
Map<String, SimpleStruct.Builder> result = MapOfStringToSimpleStructCopier
.copyToBuilder(this.mapOfStringToSimpleStruct);
if (result instanceof SdkAutoConstructMap) {
return null;
}
return result;
}
public final void setMapOfStringToSimpleStruct(Map<String, SimpleStruct.BuilderImpl> mapOfStringToSimpleStruct) {
this.mapOfStringToSimpleStruct = MapOfStringToSimpleStructCopier.copyFromBuilder(mapOfStringToSimpleStruct);
}
@Override
public final Builder mapOfStringToSimpleStruct(Map<String, SimpleStruct> mapOfStringToSimpleStruct) {
this.mapOfStringToSimpleStruct = MapOfStringToSimpleStructCopier.copy(mapOfStringToSimpleStruct);
return this;
}
public final Map<String, String> getMapOfEnumToEnum() {
if (mapOfEnumToEnum instanceof SdkAutoConstructMap) {
return null;
}
return mapOfEnumToEnum;
}
public final void setMapOfEnumToEnum(Map<String, String> mapOfEnumToEnum) {
this.mapOfEnumToEnum = MapOfEnumToEnumCopier.copy(mapOfEnumToEnum);
}
@Override
public final Builder mapOfEnumToEnumWithStrings(Map<String, String> mapOfEnumToEnum) {
this.mapOfEnumToEnum = MapOfEnumToEnumCopier.copy(mapOfEnumToEnum);
return this;
}
@Override
public final Builder mapOfEnumToEnum(Map<EnumType, EnumType> mapOfEnumToEnum) {
this.mapOfEnumToEnum = MapOfEnumToEnumCopier.copyEnumToString(mapOfEnumToEnum);
return this;
}
public final Map<String, String> getMapOfEnumToString() {
if (mapOfEnumToString instanceof SdkAutoConstructMap) {
return null;
}
return mapOfEnumToString;
}
public final void setMapOfEnumToString(Map<String, String> mapOfEnumToString) {
this.mapOfEnumToString = MapOfEnumToStringCopier.copy(mapOfEnumToString);
}
@Override
public final Builder mapOfEnumToStringWithStrings(Map<String, String> mapOfEnumToString) {
this.mapOfEnumToString = MapOfEnumToStringCopier.copy(mapOfEnumToString);
return this;
}
@Override
public final Builder mapOfEnumToString(Map<EnumType, String> mapOfEnumToString) {
this.mapOfEnumToString = MapOfEnumToStringCopier.copyEnumToString(mapOfEnumToString);
return this;
}
public final Map<String, String> getMapOfStringToEnum() {
if (mapOfStringToEnum instanceof SdkAutoConstructMap) {
return null;
}
return mapOfStringToEnum;
}
public final void setMapOfStringToEnum(Map<String, String> mapOfStringToEnum) {
this.mapOfStringToEnum = MapOfStringToEnumCopier.copy(mapOfStringToEnum);
}
@Override
public final Builder mapOfStringToEnumWithStrings(Map<String, String> mapOfStringToEnum) {
this.mapOfStringToEnum = MapOfStringToEnumCopier.copy(mapOfStringToEnum);
return this;
}
@Override
public final Builder mapOfStringToEnum(Map<String, EnumType> mapOfStringToEnum) {
this.mapOfStringToEnum = MapOfStringToEnumCopier.copyEnumToString(mapOfStringToEnum);
return this;
}
public final Map<String, SimpleStruct.Builder> getMapOfEnumToSimpleStruct() {
Map<String, SimpleStruct.Builder> result = MapOfEnumToSimpleStructCopier.copyToBuilder(this.mapOfEnumToSimpleStruct);
if (result instanceof SdkAutoConstructMap) {
return null;
}
return result;
}
public final void setMapOfEnumToSimpleStruct(Map<String, SimpleStruct.BuilderImpl> mapOfEnumToSimpleStruct) {
this.mapOfEnumToSimpleStruct = MapOfEnumToSimpleStructCopier.copyFromBuilder(mapOfEnumToSimpleStruct);
}
@Override
public final Builder mapOfEnumToSimpleStructWithStrings(Map<String, SimpleStruct> mapOfEnumToSimpleStruct) {
this.mapOfEnumToSimpleStruct = MapOfEnumToSimpleStructCopier.copy(mapOfEnumToSimpleStruct);
return this;
}
@Override
public final Builder mapOfEnumToSimpleStruct(Map<EnumType, SimpleStruct> mapOfEnumToSimpleStruct) {
this.mapOfEnumToSimpleStruct = MapOfEnumToSimpleStructCopier.copyEnumToString(mapOfEnumToSimpleStruct);
return this;
}
public final Map<String, ? extends Collection<String>> getMapOfEnumToListOfEnums() {
if (mapOfEnumToListOfEnums instanceof SdkAutoConstructMap) {
return null;
}
return mapOfEnumToListOfEnums;
}
public final void setMapOfEnumToListOfEnums(Map<String, ? extends Collection<String>> mapOfEnumToListOfEnums) {
this.mapOfEnumToListOfEnums = MapOfEnumToListOfEnumsCopier.copy(mapOfEnumToListOfEnums);
}
@Override
public final Builder mapOfEnumToListOfEnumsWithStrings(Map<String, ? extends Collection<String>> mapOfEnumToListOfEnums) {
this.mapOfEnumToListOfEnums = MapOfEnumToListOfEnumsCopier.copy(mapOfEnumToListOfEnums);
return this;
}
@Override
public final Builder mapOfEnumToListOfEnums(Map<EnumType, ? extends Collection<EnumType>> mapOfEnumToListOfEnums) {
this.mapOfEnumToListOfEnums = MapOfEnumToListOfEnumsCopier.copyEnumToString(mapOfEnumToListOfEnums);
return this;
}
public final Map<String, ? extends Map<String, String>> getMapOfEnumToMapOfStringToEnum() {
if (mapOfEnumToMapOfStringToEnum instanceof SdkAutoConstructMap) {
return null;
}
return mapOfEnumToMapOfStringToEnum;
}
public final void setMapOfEnumToMapOfStringToEnum(Map<String, ? extends Map<String, String>> mapOfEnumToMapOfStringToEnum) {
this.mapOfEnumToMapOfStringToEnum = MapOfEnumToMapOfStringToEnumCopier.copy(mapOfEnumToMapOfStringToEnum);
}
@Override
public final Builder mapOfEnumToMapOfStringToEnumWithStrings(
Map<String, ? extends Map<String, String>> mapOfEnumToMapOfStringToEnum) {
this.mapOfEnumToMapOfStringToEnum = MapOfEnumToMapOfStringToEnumCopier.copy(mapOfEnumToMapOfStringToEnum);
return this;
}
@Override
public final Builder mapOfEnumToMapOfStringToEnum(
Map<EnumType, ? extends Map<String, EnumType>> mapOfEnumToMapOfStringToEnum) {
this.mapOfEnumToMapOfStringToEnum = MapOfEnumToMapOfStringToEnumCopier.copyEnumToString(mapOfEnumToMapOfStringToEnum);
return this;
}
public final Instant getTimestampMember() {
return timestampMember;
}
public final void setTimestampMember(Instant timestampMember) {
this.timestampMember = timestampMember;
}
@Override
public final Builder timestampMember(Instant timestampMember) {
this.timestampMember = timestampMember;
return this;
}
public final StructWithTimestamp.Builder getStructWithNestedTimestampMember() {
return structWithNestedTimestampMember != null ? structWithNestedTimestampMember.toBuilder() : null;
}
public final void setStructWithNestedTimestampMember(StructWithTimestamp.BuilderImpl structWithNestedTimestampMember) {
this.structWithNestedTimestampMember = structWithNestedTimestampMember != null ? structWithNestedTimestampMember
.build() : null;
}
@Override
public final Builder structWithNestedTimestampMember(StructWithTimestamp structWithNestedTimestampMember) {
this.structWithNestedTimestampMember = structWithNestedTimestampMember;
return this;
}
public final ByteBuffer getBlobArg() {
return blobArg == null ? null : blobArg.asByteBuffer();
}
public final void setBlobArg(ByteBuffer blobArg) {
blobArg(blobArg == null ? null : SdkBytes.fromByteBuffer(blobArg));
}
@Override
public final Builder blobArg(SdkBytes blobArg) {
this.blobArg = blobArg;
return this;
}
public final StructWithNestedBlobType.Builder getStructWithNestedBlob() {
return structWithNestedBlob != null ? structWithNestedBlob.toBuilder() : null;
}
public final void setStructWithNestedBlob(StructWithNestedBlobType.BuilderImpl structWithNestedBlob) {
this.structWithNestedBlob = structWithNestedBlob != null ? structWithNestedBlob.build() : null;
}
@Override
public final Builder structWithNestedBlob(StructWithNestedBlobType structWithNestedBlob) {
this.structWithNestedBlob = structWithNestedBlob;
return this;
}
public final Map<String, ByteBuffer> getBlobMap() {
if (blobMap instanceof SdkAutoConstructMap) {
return null;
}
return blobMap == null ? null : blobMap.entrySet().stream()
.collect(Collectors.toMap(e -> e.getKey(), e -> e.getValue().asByteBuffer()));
}
public final void setBlobMap(Map<String, ByteBuffer> blobMap) {
blobMap(blobMap == null ? null : blobMap.entrySet().stream()
.collect(Collectors.toMap(e -> e.getKey(), e -> SdkBytes.fromByteBuffer(e.getValue()))));
}
@Override
public final Builder blobMap(Map<String, SdkBytes> blobMap) {
this.blobMap = BlobMapTypeCopier.copy(blobMap);
return this;
}
public final List<ByteBuffer> getListOfBlobs() {
if (listOfBlobs instanceof SdkAutoConstructList) {
return null;
}
return listOfBlobs == null ? null : listOfBlobs.stream().map(SdkBytes::asByteBuffer).collect(Collectors.toList());
}
public final void setListOfBlobs(Collection<ByteBuffer> listOfBlobs) {
listOfBlobs(listOfBlobs == null ? null : listOfBlobs.stream().map(SdkBytes::fromByteBuffer)
.collect(Collectors.toList()));
}
@Override
public final Builder listOfBlobs(Collection<SdkBytes> listOfBlobs) {
this.listOfBlobs = ListOfBlobsTypeCopier.copy(listOfBlobs);
return this;
}
@Override
@SafeVarargs
public final Builder listOfBlobs(SdkBytes... listOfBlobs) {
listOfBlobs(Arrays.asList(listOfBlobs));
return this;
}
public final RecursiveStructType.Builder getRecursiveStruct() {
return recursiveStruct != null ? recursiveStruct.toBuilder() : null;
}
public final void setRecursiveStruct(RecursiveStructType.BuilderImpl recursiveStruct) {
this.recursiveStruct = recursiveStruct != null ? recursiveStruct.build() : null;
}
@Override
public final Builder recursiveStruct(RecursiveStructType recursiveStruct) {
this.recursiveStruct = recursiveStruct;
return this;
}
public final BaseType.Builder getPolymorphicTypeWithSubTypes() {
return polymorphicTypeWithSubTypes != null ? polymorphicTypeWithSubTypes.toBuilder() : null;
}
public final void setPolymorphicTypeWithSubTypes(BaseType.BuilderImpl polymorphicTypeWithSubTypes) {
this.polymorphicTypeWithSubTypes = polymorphicTypeWithSubTypes != null ? polymorphicTypeWithSubTypes.build() : null;
}
@Override
public final Builder polymorphicTypeWithSubTypes(BaseType polymorphicTypeWithSubTypes) {
this.polymorphicTypeWithSubTypes = polymorphicTypeWithSubTypes;
return this;
}
public final SubTypeOne.Builder getPolymorphicTypeWithoutSubTypes() {
return polymorphicTypeWithoutSubTypes != null ? polymorphicTypeWithoutSubTypes.toBuilder() : null;
}
public final void setPolymorphicTypeWithoutSubTypes(SubTypeOne.BuilderImpl polymorphicTypeWithoutSubTypes) {
this.polymorphicTypeWithoutSubTypes = polymorphicTypeWithoutSubTypes != null ? polymorphicTypeWithoutSubTypes.build()
: null;
}
@Override
public final Builder polymorphicTypeWithoutSubTypes(SubTypeOne polymorphicTypeWithoutSubTypes) {
this.polymorphicTypeWithoutSubTypes = polymorphicTypeWithoutSubTypes;
return this;
}
public final String getEnumType() {
return enumType;
}
public final void setEnumType(String enumType) {
this.enumType = enumType;
}
@Override
public final Builder enumType(String enumType) {
this.enumType = enumType;
return this;
}
@Override
public final Builder enumType(EnumType enumType) {
this.enumType(enumType == null ? null : enumType.toString());
return this;
}
public final Underscore_Name_Type.Builder getUnderscore_Name_Type() {
return underscore_Name_Type != null ? underscore_Name_Type.toBuilder() : null;
}
public final void setUnderscore_Name_Type(Underscore_Name_Type.BuilderImpl underscore_Name_Type) {
this.underscore_Name_Type = underscore_Name_Type != null ? underscore_Name_Type.build() : null;
}
@Override
public final Builder underscore_Name_Type(Underscore_Name_Type underscore_Name_Type) {
this.underscore_Name_Type = underscore_Name_Type;
return this;
}
public final Document getMyDocument() {
return myDocument;
}
public final void setMyDocument(Document myDocument) {
this.myDocument = myDocument;
}
@Override
public final Builder myDocument(Document myDocument) {
this.myDocument = myDocument;
return this;
}
public final AllTypesUnionStructure.Builder getAllTypesUnionStructure() {
return allTypesUnionStructure != null ? allTypesUnionStructure.toBuilder() : null;
}
public final void setAllTypesUnionStructure(AllTypesUnionStructure.BuilderImpl allTypesUnionStructure) {
this.allTypesUnionStructure = allTypesUnionStructure != null ? allTypesUnionStructure.build() : null;
}
@Override
public final Builder allTypesUnionStructure(AllTypesUnionStructure allTypesUnionStructure) {
this.allTypesUnionStructure = allTypesUnionStructure;
return this;
}
@Override
public AllTypesResponse build() {
return new AllTypesResponse(this);
}
@Override
public List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
}
}
| 3,451 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/streaminginputoperationrequest.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
import java.util.function.Consumer;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class StreamingInputOperationRequest extends JsonProtocolTestsRequest implements
ToCopyableBuilder<StreamingInputOperationRequest.Builder, StreamingInputOperationRequest> {
private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList());
private StreamingInputOperationRequest(BuilderImpl builder) {
super(builder);
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class<? extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof StreamingInputOperationRequest)) {
return false;
}
return true;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("StreamingInputOperationRequest").build();
}
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
return Optional.empty();
}
@Override
public final List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
public interface Builder extends JsonProtocolTestsRequest.Builder, SdkPojo,
CopyableBuilder<Builder, StreamingInputOperationRequest> {
@Override
Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration);
@Override
Builder overrideConfiguration(Consumer<AwsRequestOverrideConfiguration.Builder> builderConsumer);
}
static final class BuilderImpl extends JsonProtocolTestsRequest.BuilderImpl implements Builder {
private BuilderImpl() {
}
private BuilderImpl(StreamingInputOperationRequest model) {
super(model);
}
@Override
public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) {
super.overrideConfiguration(overrideConfiguration);
return this;
}
@Override
public Builder overrideConfiguration(Consumer<AwsRequestOverrideConfiguration.Builder> builderConsumer) {
super.overrideConfiguration(builderConsumer);
return this;
}
@Override
public StreamingInputOperationRequest build() {
return new StreamingInputOperationRequest(this);
}
@Override
public List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
}
}
| 3,452 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/basetype.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
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.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class BaseType implements SdkPojo, Serializable, ToCopyableBuilder<BaseType.Builder, BaseType> {
private static final SdkField<String> BASE_MEMBER_FIELD = SdkField.<String> builder(MarshallingType.STRING)
.memberName("BaseMember").getter(getter(BaseType::baseMember)).setter(setter(Builder::baseMember))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("BaseMember").build()).build();
private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(BASE_MEMBER_FIELD));
private static final long serialVersionUID = 1L;
private final String baseMember;
private final String customShape1;
private final Integer customShape2;
private BaseType(BuilderImpl builder) {
this.baseMember = builder.baseMember;
this.customShape1 = builder.customShape1;
this.customShape2 = builder.customShape2;
}
/**
* Returns the value of the BaseMember property for this object.
*
* @return The value of the BaseMember property for this object.
*/
public final String baseMember() {
return baseMember;
}
/**
* Custom shape of type string
*
* @return Custom shape of type string
*/
public final String customShape1() {
return customShape1;
}
/**
* Custom shape of type integer
*
* @return Custom shape of type integer
*/
public final Integer customShape2() {
return customShape2;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class<? extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(baseMember());
hashCode = 31 * hashCode + Objects.hashCode(customShape1());
hashCode = 31 * hashCode + Objects.hashCode(customShape2());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof BaseType)) {
return false;
}
BaseType other = (BaseType) obj;
return Objects.equals(baseMember(), other.baseMember()) && Objects.equals(customShape1(), other.customShape1())
&& Objects.equals(customShape2(), other.customShape2());
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("BaseType").add("BaseMember", baseMember()).add("CustomShape1", customShape1())
.add("CustomShape2", customShape2()).build();
}
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
switch (fieldName) {
case "BaseMember":
return Optional.ofNullable(clazz.cast(baseMember()));
case "CustomShape1":
return Optional.ofNullable(clazz.cast(customShape1()));
case "CustomShape2":
return Optional.ofNullable(clazz.cast(customShape2()));
default:
return Optional.empty();
}
}
@Override
public final List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
private static <T> Function<Object, T> getter(Function<BaseType, T> g) {
return obj -> g.apply((BaseType) obj);
}
private static <T> BiConsumer<Object, T> setter(BiConsumer<Builder, T> s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
public interface Builder extends SdkPojo, CopyableBuilder<Builder, BaseType> {
/**
* Sets the value of the BaseMember property for this object.
*
* @param baseMember
* The new value for the BaseMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder baseMember(String baseMember);
/**
* Custom shape of type string
*
* @param customShape1
* Custom shape of type string
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder customShape1(String customShape1);
/**
* Custom shape of type integer
*
* @param customShape2
* Custom shape of type integer
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder customShape2(Integer customShape2);
}
static final class BuilderImpl implements Builder {
private String baseMember;
private String customShape1;
private Integer customShape2;
private BuilderImpl() {
}
private BuilderImpl(BaseType model) {
baseMember(model.baseMember);
customShape1(model.customShape1);
customShape2(model.customShape2);
}
public final String getBaseMember() {
return baseMember;
}
public final void setBaseMember(String baseMember) {
this.baseMember = baseMember;
}
@Override
public final Builder baseMember(String baseMember) {
this.baseMember = baseMember;
return this;
}
public final String getCustomShape1() {
return customShape1;
}
public final void setCustomShape1(String customShape1) {
this.customShape1 = customShape1;
}
@Override
public final Builder customShape1(String customShape1) {
this.customShape1 = customShape1;
return this;
}
public final Integer getCustomShape2() {
return customShape2;
}
public final void setCustomShape2(Integer customShape2) {
this.customShape2 = customShape2;
}
@Override
public final Builder customShape2(Integer customShape2) {
this.customShape2 = customShape2;
return this;
}
@Override
public BaseType build() {
return new BaseType(this);
}
@Override
public List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
}
}
| 3,453 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/streamingoutputoperationrequest.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
import java.util.function.Consumer;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
@Generated("software.amazon.awssdk:codegen")
public final class StreamingOutputOperationRequest extends JsonProtocolTestsRequest implements
ToCopyableBuilder<StreamingOutputOperationRequest.Builder, StreamingOutputOperationRequest> {
private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList());
private StreamingOutputOperationRequest(BuilderImpl builder) {
super(builder);
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class<? extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof StreamingOutputOperationRequest)) {
return false;
}
return true;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("StreamingOutputOperationRequest").build();
}
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
return Optional.empty();
}
@Override
public final List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
public interface Builder extends JsonProtocolTestsRequest.Builder, SdkPojo,
CopyableBuilder<Builder, StreamingOutputOperationRequest> {
@Override
Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration);
@Override
Builder overrideConfiguration(Consumer<AwsRequestOverrideConfiguration.Builder> builderConsumer);
}
static final class BuilderImpl extends JsonProtocolTestsRequest.BuilderImpl implements Builder {
private BuilderImpl() {
}
private BuilderImpl(StreamingOutputOperationRequest model) {
super(model);
}
@Override
public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) {
super.overrideConfiguration(overrideConfiguration);
return this;
}
@Override
public Builder overrideConfiguration(Consumer<AwsRequestOverrideConfiguration.Builder> builderConsumer) {
super.overrideConfiguration(builderConsumer);
return this;
}
@Override
public StreamingOutputOperationRequest build() {
return new StreamingOutputOperationRequest(this);
}
@Override
public List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
}
}
| 3,454 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/mapofstringtosimplestructcopier.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import static java.util.stream.Collectors.toMap;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.Map;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
@Generated("software.amazon.awssdk:codegen")
final class MapOfStringToSimpleStructCopier {
static Map<String, SimpleStruct> copy(Map<String, ? extends SimpleStruct> mapOfStringToSimpleStructParam) {
Map<String, SimpleStruct> map;
if (mapOfStringToSimpleStructParam == null || mapOfStringToSimpleStructParam instanceof SdkAutoConstructMap) {
map = DefaultSdkAutoConstructMap.getInstance();
} else {
Map<String, SimpleStruct> modifiableMap = new LinkedHashMap<>();
mapOfStringToSimpleStructParam.forEach((key, value) -> {
modifiableMap.put(key, value);
});
map = Collections.unmodifiableMap(modifiableMap);
}
return map;
}
static Map<String, SimpleStruct> copyFromBuilder(Map<String, ? extends SimpleStruct.Builder> mapOfStringToSimpleStructParam) {
Map<String, SimpleStruct> map;
if (mapOfStringToSimpleStructParam == null || mapOfStringToSimpleStructParam instanceof SdkAutoConstructMap) {
map = DefaultSdkAutoConstructMap.getInstance();
} else {
Map<String, SimpleStruct> modifiableMap = new LinkedHashMap<>();
mapOfStringToSimpleStructParam.forEach((key, value) -> {
SimpleStruct member = value == null ? null : value.build();
modifiableMap.put(key, member);
});
map = Collections.unmodifiableMap(modifiableMap);
}
return map;
}
static Map<String, SimpleStruct.Builder> copyToBuilder(Map<String, ? extends SimpleStruct> mapOfStringToSimpleStructParam) {
Map<String, SimpleStruct.Builder> map;
if (mapOfStringToSimpleStructParam == null || mapOfStringToSimpleStructParam instanceof SdkAutoConstructMap) {
map = DefaultSdkAutoConstructMap.getInstance();
} else {
Map<String, SimpleStruct.Builder> modifiableMap = new LinkedHashMap<>();
mapOfStringToSimpleStructParam.forEach((key, value) -> {
SimpleStruct.Builder member = value == null ? null : value.toBuilder();
modifiableMap.put(key, member);
});
map = Collections.unmodifiableMap(modifiableMap);
}
return map;
}
}
| 3,455 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/eventstreamoperationwithonlyinputrequest.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
import java.util.function.Consumer;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class EventStreamOperationWithOnlyInputRequest extends JsonProtocolTestsRequest implements
ToCopyableBuilder<EventStreamOperationWithOnlyInputRequest.Builder, EventStreamOperationWithOnlyInputRequest> {
private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList());
private EventStreamOperationWithOnlyInputRequest(BuilderImpl builder) {
super(builder);
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class<? extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof EventStreamOperationWithOnlyInputRequest)) {
return false;
}
return true;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("EventStreamOperationWithOnlyInputRequest").build();
}
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
return Optional.empty();
}
@Override
public final List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
public interface Builder extends JsonProtocolTestsRequest.Builder, SdkPojo,
CopyableBuilder<Builder, EventStreamOperationWithOnlyInputRequest> {
@Override
Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration);
@Override
Builder overrideConfiguration(Consumer<AwsRequestOverrideConfiguration.Builder> builderConsumer);
}
static final class BuilderImpl extends JsonProtocolTestsRequest.BuilderImpl implements Builder {
private BuilderImpl() {
}
private BuilderImpl(EventStreamOperationWithOnlyInputRequest model) {
super(model);
}
@Override
public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) {
super.overrideConfiguration(overrideConfiguration);
return this;
}
@Override
public Builder overrideConfiguration(Consumer<AwsRequestOverrideConfiguration.Builder> builderConsumer) {
super.overrideConfiguration(builderConsumer);
return this;
}
@Override
public EventStreamOperationWithOnlyInputRequest build() {
return new EventStreamOperationWithOnlyInputRequest(this);
}
@Override
public List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
}
}
| 3,456 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/listoflistoflistofstringscopier.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import static java.util.stream.Collectors.toList;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
@Generated("software.amazon.awssdk:codegen")
final class ListOfListOfListOfStringsCopier {
static List<List<List<String>>> copy(
Collection<? extends Collection<? extends Collection<String>>> listOfListOfListOfStringsParam) {
List<List<List<String>>> list;
if (listOfListOfListOfStringsParam == null || listOfListOfListOfStringsParam instanceof SdkAutoConstructList) {
list = DefaultSdkAutoConstructList.getInstance();
} else {
List<List<List<String>>> modifiableList = new ArrayList<>();
listOfListOfListOfStringsParam.forEach(entry -> {
List<List<String>> list1;
if (entry == null || entry instanceof SdkAutoConstructList) {
list1 = DefaultSdkAutoConstructList.getInstance();
} else {
List<List<String>> modifiableList1 = new ArrayList<>();
entry.forEach(entry1 -> {
List<String> list2;
if (entry1 == null || entry1 instanceof SdkAutoConstructList) {
list2 = DefaultSdkAutoConstructList.getInstance();
} else {
List<String> modifiableList2 = new ArrayList<>();
entry1.forEach(entry2 -> {
modifiableList2.add(entry2);
});
list2 = Collections.unmodifiableList(modifiableList2);
}
modifiableList1.add(list2);
});
list1 = Collections.unmodifiableList(modifiableList1);
}
modifiableList.add(list1);
});
list = Collections.unmodifiableList(modifiableList);
}
return list;
}
}
| 3,457 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/eventstreamoperationrequest.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
import java.util.function.Consumer;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class EventStreamOperationRequest extends JsonProtocolTestsRequest implements
ToCopyableBuilder<EventStreamOperationRequest.Builder, EventStreamOperationRequest> {
private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList());
private EventStreamOperationRequest(BuilderImpl builder) {
super(builder);
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class<? extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof EventStreamOperationRequest)) {
return false;
}
return true;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("EventStreamOperationRequest").build();
}
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
return Optional.empty();
}
@Override
public final List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
public interface Builder extends JsonProtocolTestsRequest.Builder, SdkPojo,
CopyableBuilder<Builder, EventStreamOperationRequest> {
@Override
Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration);
@Override
Builder overrideConfiguration(Consumer<AwsRequestOverrideConfiguration.Builder> builderConsumer);
}
static final class BuilderImpl extends JsonProtocolTestsRequest.BuilderImpl implements Builder {
private BuilderImpl() {
}
private BuilderImpl(EventStreamOperationRequest model) {
super(model);
}
@Override
public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) {
super.overrideConfiguration(overrideConfiguration);
return this;
}
@Override
public Builder overrideConfiguration(Consumer<AwsRequestOverrideConfiguration.Builder> builderConsumer) {
super.overrideConfiguration(builderConsumer);
return this;
}
@Override
public EventStreamOperationRequest build() {
return new EventStreamOperationRequest(this);
}
@Override
public List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
}
}
| 3,458 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/jsonprotocoltestsresponsemetadata.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.annotations.SdkPublicApi;
import software.amazon.awssdk.awscore.AwsResponseMetadata;
@Generated("software.amazon.awssdk:codegen")
@SdkPublicApi
public final class JsonProtocolTestsResponseMetadata extends AwsResponseMetadata {
private JsonProtocolTestsResponseMetadata(AwsResponseMetadata responseMetadata) {
super(responseMetadata);
}
public static JsonProtocolTestsResponseMetadata create(AwsResponseMetadata responseMetadata) {
return new JsonProtocolTestsResponseMetadata(responseMetadata);
}
}
| 3,459 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/alltypesunionstructure.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import java.io.Serializable;
import java.nio.ByteBuffer;
import java.time.Instant;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.EnumSet;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.Set;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkBytes;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.document.Document;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.traits.MapTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class AllTypesUnionStructure implements SdkPojo, Serializable,
ToCopyableBuilder<AllTypesUnionStructure.Builder, AllTypesUnionStructure> {
private static final SdkField<String> STRING_MEMBER_FIELD = SdkField.<String> builder(MarshallingType.STRING)
.memberName("StringMember").getter(getter(AllTypesUnionStructure::stringMember))
.setter(setter(Builder::stringMember))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StringMember").build()).build();
private static final SdkField<Integer> INTEGER_MEMBER_FIELD = SdkField.<Integer> builder(MarshallingType.INTEGER)
.memberName("IntegerMember").getter(getter(AllTypesUnionStructure::integerMember))
.setter(setter(Builder::integerMember))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("IntegerMember").build()).build();
private static final SdkField<Boolean> BOOLEAN_MEMBER_FIELD = SdkField.<Boolean> builder(MarshallingType.BOOLEAN)
.memberName("BooleanMember").getter(getter(AllTypesUnionStructure::booleanMember))
.setter(setter(Builder::booleanMember))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("BooleanMember").build()).build();
private static final SdkField<Float> FLOAT_MEMBER_FIELD = SdkField.<Float> builder(MarshallingType.FLOAT)
.memberName("FloatMember").getter(getter(AllTypesUnionStructure::floatMember)).setter(setter(Builder::floatMember))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("FloatMember").build()).build();
private static final SdkField<Double> DOUBLE_MEMBER_FIELD = SdkField.<Double> builder(MarshallingType.DOUBLE)
.memberName("DoubleMember").getter(getter(AllTypesUnionStructure::doubleMember))
.setter(setter(Builder::doubleMember))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DoubleMember").build()).build();
private static final SdkField<Long> LONG_MEMBER_FIELD = SdkField.<Long> builder(MarshallingType.LONG)
.memberName("LongMember").getter(getter(AllTypesUnionStructure::longMember)).setter(setter(Builder::longMember))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LongMember").build()).build();
private static final SdkField<Short> SHORT_MEMBER_FIELD = SdkField.<Short> builder(MarshallingType.SHORT)
.memberName("ShortMember").getter(getter(AllTypesUnionStructure::shortMember)).setter(setter(Builder::shortMember))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ShortMember").build()).build();
private static final SdkField<List<String>> SIMPLE_LIST_FIELD = SdkField
.<List<String>> builder(MarshallingType.LIST)
.memberName("SimpleList")
.getter(getter(AllTypesUnionStructure::simpleList))
.setter(setter(Builder::simpleList))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SimpleList").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField<List<String>> LIST_OF_ENUMS_FIELD = SdkField
.<List<String>> builder(MarshallingType.LIST)
.memberName("ListOfEnums")
.getter(getter(AllTypesUnionStructure::listOfEnumsAsStrings))
.setter(setter(Builder::listOfEnumsWithStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ListOfEnums").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField<List<Map<String, String>>> LIST_OF_MAPS_FIELD = SdkField
.<List<Map<String, String>>> builder(MarshallingType.LIST)
.memberName("ListOfMaps")
.getter(getter(AllTypesUnionStructure::listOfMaps))
.setter(setter(Builder::listOfMaps))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ListOfMaps").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<Map<String, String>> builder(MarshallingType.MAP)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder()
.location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build())
.build()).build()).build()).build();
private static final SdkField<List<SimpleStruct>> LIST_OF_STRUCTS_FIELD = SdkField
.<List<SimpleStruct>> builder(MarshallingType.LIST)
.memberName("ListOfStructs")
.getter(getter(AllTypesUnionStructure::listOfStructs))
.setter(setter(Builder::listOfStructs))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ListOfStructs").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<SimpleStruct> builder(MarshallingType.SDK_POJO)
.constructor(SimpleStruct::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField<List<Map<String, String>>> LIST_OF_MAP_OF_ENUM_TO_STRING_FIELD = SdkField
.<List<Map<String, String>>> builder(MarshallingType.LIST)
.memberName("ListOfMapOfEnumToString")
.getter(getter(AllTypesUnionStructure::listOfMapOfEnumToStringAsStrings))
.setter(setter(Builder::listOfMapOfEnumToStringWithStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ListOfMapOfEnumToString").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<Map<String, String>> builder(MarshallingType.MAP)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder()
.location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build())
.build()).build()).build()).build();
private static final SdkField<List<Map<String, SimpleStruct>>> LIST_OF_MAP_OF_STRING_TO_STRUCT_FIELD = SdkField
.<List<Map<String, SimpleStruct>>> builder(MarshallingType.LIST)
.memberName("ListOfMapOfStringToStruct")
.getter(getter(AllTypesUnionStructure::listOfMapOfStringToStruct))
.setter(setter(Builder::listOfMapOfStringToStruct))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ListOfMapOfStringToStruct").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<Map<String, SimpleStruct>> builder(MarshallingType.MAP)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<SimpleStruct> builder(MarshallingType.SDK_POJO)
.constructor(SimpleStruct::builder)
.traits(LocationTrait.builder()
.location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build())
.build()).build()).build()).build();
private static final SdkField<Map<String, List<Integer>>> MAP_OF_STRING_TO_INTEGER_LIST_FIELD = SdkField
.<Map<String, List<Integer>>> builder(MarshallingType.MAP)
.memberName("MapOfStringToIntegerList")
.getter(getter(AllTypesUnionStructure::mapOfStringToIntegerList))
.setter(setter(Builder::mapOfStringToIntegerList))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MapOfStringToIntegerList").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<List<Integer>> builder(MarshallingType.LIST)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<Integer> builder(MarshallingType.INTEGER)
.traits(LocationTrait.builder()
.location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build())
.build()).build()).build()).build();
private static final SdkField<Map<String, String>> MAP_OF_STRING_TO_STRING_FIELD = SdkField
.<Map<String, String>> builder(MarshallingType.MAP)
.memberName("MapOfStringToString")
.getter(getter(AllTypesUnionStructure::mapOfStringToString))
.setter(setter(Builder::mapOfStringToString))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MapOfStringToString").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build()).build()).build();
private static final SdkField<Map<String, SimpleStruct>> MAP_OF_STRING_TO_SIMPLE_STRUCT_FIELD = SdkField
.<Map<String, SimpleStruct>> builder(MarshallingType.MAP)
.memberName("MapOfStringToSimpleStruct")
.getter(getter(AllTypesUnionStructure::mapOfStringToSimpleStruct))
.setter(setter(Builder::mapOfStringToSimpleStruct))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MapOfStringToSimpleStruct").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<SimpleStruct> builder(MarshallingType.SDK_POJO)
.constructor(SimpleStruct::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build()).build()).build();
private static final SdkField<Map<String, String>> MAP_OF_ENUM_TO_ENUM_FIELD = SdkField
.<Map<String, String>> builder(MarshallingType.MAP)
.memberName("MapOfEnumToEnum")
.getter(getter(AllTypesUnionStructure::mapOfEnumToEnumAsStrings))
.setter(setter(Builder::mapOfEnumToEnumWithStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MapOfEnumToEnum").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build()).build()).build();
private static final SdkField<Map<String, String>> MAP_OF_ENUM_TO_STRING_FIELD = SdkField
.<Map<String, String>> builder(MarshallingType.MAP)
.memberName("MapOfEnumToString")
.getter(getter(AllTypesUnionStructure::mapOfEnumToStringAsStrings))
.setter(setter(Builder::mapOfEnumToStringWithStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MapOfEnumToString").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build()).build()).build();
private static final SdkField<Map<String, String>> MAP_OF_STRING_TO_ENUM_FIELD = SdkField
.<Map<String, String>> builder(MarshallingType.MAP)
.memberName("MapOfStringToEnum")
.getter(getter(AllTypesUnionStructure::mapOfStringToEnumAsStrings))
.setter(setter(Builder::mapOfStringToEnumWithStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MapOfStringToEnum").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build()).build()).build();
private static final SdkField<Map<String, SimpleStruct>> MAP_OF_ENUM_TO_SIMPLE_STRUCT_FIELD = SdkField
.<Map<String, SimpleStruct>> builder(MarshallingType.MAP)
.memberName("MapOfEnumToSimpleStruct")
.getter(getter(AllTypesUnionStructure::mapOfEnumToSimpleStructAsStrings))
.setter(setter(Builder::mapOfEnumToSimpleStructWithStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MapOfEnumToSimpleStruct").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<SimpleStruct> builder(MarshallingType.SDK_POJO)
.constructor(SimpleStruct::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build()).build()).build();
private static final SdkField<Map<String, List<String>>> MAP_OF_ENUM_TO_LIST_OF_ENUMS_FIELD = SdkField
.<Map<String, List<String>>> builder(MarshallingType.MAP)
.memberName("MapOfEnumToListOfEnums")
.getter(getter(AllTypesUnionStructure::mapOfEnumToListOfEnumsAsStrings))
.setter(setter(Builder::mapOfEnumToListOfEnumsWithStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MapOfEnumToListOfEnums").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<List<String>> builder(MarshallingType.LIST)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder()
.location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build())
.build()).build()).build()).build();
private static final SdkField<Map<String, Map<String, String>>> MAP_OF_ENUM_TO_MAP_OF_STRING_TO_ENUM_FIELD = SdkField
.<Map<String, Map<String, String>>> builder(MarshallingType.MAP)
.memberName("MapOfEnumToMapOfStringToEnum")
.getter(getter(AllTypesUnionStructure::mapOfEnumToMapOfStringToEnumAsStrings))
.setter(setter(Builder::mapOfEnumToMapOfStringToEnumWithStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MapOfEnumToMapOfStringToEnum")
.build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<Map<String, String>> builder(MarshallingType.MAP)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder()
.location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build())
.build()).build()).build()).build();
private static final SdkField<Instant> TIMESTAMP_MEMBER_FIELD = SdkField.<Instant> builder(MarshallingType.INSTANT)
.memberName("TimestampMember").getter(getter(AllTypesUnionStructure::timestampMember))
.setter(setter(Builder::timestampMember))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TimestampMember").build()).build();
private static final SdkField<StructWithTimestamp> STRUCT_WITH_NESTED_TIMESTAMP_MEMBER_FIELD = SdkField
.<StructWithTimestamp> builder(MarshallingType.SDK_POJO)
.memberName("StructWithNestedTimestampMember")
.getter(getter(AllTypesUnionStructure::structWithNestedTimestampMember))
.setter(setter(Builder::structWithNestedTimestampMember))
.constructor(StructWithTimestamp::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StructWithNestedTimestampMember")
.build()).build();
private static final SdkField<SdkBytes> BLOB_ARG_FIELD = SdkField.<SdkBytes> builder(MarshallingType.SDK_BYTES)
.memberName("BlobArg").getter(getter(AllTypesUnionStructure::blobArg)).setter(setter(Builder::blobArg))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("BlobArg").build()).build();
private static final SdkField<StructWithNestedBlobType> STRUCT_WITH_NESTED_BLOB_FIELD = SdkField
.<StructWithNestedBlobType> builder(MarshallingType.SDK_POJO).memberName("StructWithNestedBlob")
.getter(getter(AllTypesUnionStructure::structWithNestedBlob)).setter(setter(Builder::structWithNestedBlob))
.constructor(StructWithNestedBlobType::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StructWithNestedBlob").build())
.build();
private static final SdkField<Map<String, SdkBytes>> BLOB_MAP_FIELD = SdkField
.<Map<String, SdkBytes>> builder(MarshallingType.MAP)
.memberName("BlobMap")
.getter(getter(AllTypesUnionStructure::blobMap))
.setter(setter(Builder::blobMap))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("BlobMap").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<SdkBytes> builder(MarshallingType.SDK_BYTES)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build()).build()).build();
private static final SdkField<List<SdkBytes>> LIST_OF_BLOBS_FIELD = SdkField
.<List<SdkBytes>> builder(MarshallingType.LIST)
.memberName("ListOfBlobs")
.getter(getter(AllTypesUnionStructure::listOfBlobs))
.setter(setter(Builder::listOfBlobs))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ListOfBlobs").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<SdkBytes> builder(MarshallingType.SDK_BYTES)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField<RecursiveStructType> RECURSIVE_STRUCT_FIELD = SdkField
.<RecursiveStructType> builder(MarshallingType.SDK_POJO).memberName("RecursiveStruct")
.getter(getter(AllTypesUnionStructure::recursiveStruct)).setter(setter(Builder::recursiveStruct))
.constructor(RecursiveStructType::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RecursiveStruct").build()).build();
private static final SdkField<BaseType> POLYMORPHIC_TYPE_WITH_SUB_TYPES_FIELD = SdkField
.<BaseType> builder(MarshallingType.SDK_POJO)
.memberName("PolymorphicTypeWithSubTypes")
.getter(getter(AllTypesUnionStructure::polymorphicTypeWithSubTypes))
.setter(setter(Builder::polymorphicTypeWithSubTypes))
.constructor(BaseType::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("PolymorphicTypeWithSubTypes")
.build()).build();
private static final SdkField<SubTypeOne> POLYMORPHIC_TYPE_WITHOUT_SUB_TYPES_FIELD = SdkField
.<SubTypeOne> builder(MarshallingType.SDK_POJO)
.memberName("PolymorphicTypeWithoutSubTypes")
.getter(getter(AllTypesUnionStructure::polymorphicTypeWithoutSubTypes))
.setter(setter(Builder::polymorphicTypeWithoutSubTypes))
.constructor(SubTypeOne::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("PolymorphicTypeWithoutSubTypes")
.build()).build();
private static final SdkField<String> ENUM_TYPE_FIELD = SdkField.<String> builder(MarshallingType.STRING)
.memberName("EnumType").getter(getter(AllTypesUnionStructure::enumTypeAsString)).setter(setter(Builder::enumType))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EnumType").build()).build();
private static final SdkField<Underscore_Name_Type> UNDERSCORE_NAME_TYPE_FIELD = SdkField
.<Underscore_Name_Type> builder(MarshallingType.SDK_POJO).memberName("Underscore_Name_Type")
.getter(getter(AllTypesUnionStructure::underscore_Name_Type)).setter(setter(Builder::underscore_Name_Type))
.constructor(Underscore_Name_Type::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Underscore_Name_Type").build())
.build();
private static final SdkField<Document> MY_DOCUMENT_FIELD = SdkField.<Document> builder(MarshallingType.DOCUMENT)
.memberName("MyDocument").getter(getter(AllTypesUnionStructure::myDocument)).setter(setter(Builder::myDocument))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MyDocument").build()).build();
private static final SdkField<AllTypesUnionStructure> ALL_TYPES_UNION_STRUCTURE_FIELD = SdkField
.<AllTypesUnionStructure> builder(MarshallingType.SDK_POJO).memberName("AllTypesUnionStructure")
.getter(getter(AllTypesUnionStructure::allTypesUnionStructure)).setter(setter(Builder::allTypesUnionStructure))
.constructor(AllTypesUnionStructure::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AllTypesUnionStructure").build())
.build();
private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(STRING_MEMBER_FIELD,
INTEGER_MEMBER_FIELD, BOOLEAN_MEMBER_FIELD, FLOAT_MEMBER_FIELD, DOUBLE_MEMBER_FIELD, LONG_MEMBER_FIELD,
SHORT_MEMBER_FIELD, SIMPLE_LIST_FIELD, LIST_OF_ENUMS_FIELD, LIST_OF_MAPS_FIELD, LIST_OF_STRUCTS_FIELD,
LIST_OF_MAP_OF_ENUM_TO_STRING_FIELD, LIST_OF_MAP_OF_STRING_TO_STRUCT_FIELD, MAP_OF_STRING_TO_INTEGER_LIST_FIELD,
MAP_OF_STRING_TO_STRING_FIELD, MAP_OF_STRING_TO_SIMPLE_STRUCT_FIELD, MAP_OF_ENUM_TO_ENUM_FIELD,
MAP_OF_ENUM_TO_STRING_FIELD, MAP_OF_STRING_TO_ENUM_FIELD, MAP_OF_ENUM_TO_SIMPLE_STRUCT_FIELD,
MAP_OF_ENUM_TO_LIST_OF_ENUMS_FIELD, MAP_OF_ENUM_TO_MAP_OF_STRING_TO_ENUM_FIELD, TIMESTAMP_MEMBER_FIELD,
STRUCT_WITH_NESTED_TIMESTAMP_MEMBER_FIELD, BLOB_ARG_FIELD, STRUCT_WITH_NESTED_BLOB_FIELD, BLOB_MAP_FIELD,
LIST_OF_BLOBS_FIELD, RECURSIVE_STRUCT_FIELD, POLYMORPHIC_TYPE_WITH_SUB_TYPES_FIELD,
POLYMORPHIC_TYPE_WITHOUT_SUB_TYPES_FIELD, ENUM_TYPE_FIELD, UNDERSCORE_NAME_TYPE_FIELD, MY_DOCUMENT_FIELD,
ALL_TYPES_UNION_STRUCTURE_FIELD));
private static final long serialVersionUID = 1L;
private final String stringMember;
private final Integer integerMember;
private final Boolean booleanMember;
private final Float floatMember;
private final Double doubleMember;
private final Long longMember;
private final Short shortMember;
private final List<String> simpleList;
private final List<String> listOfEnums;
private final List<Map<String, String>> listOfMaps;
private final List<SimpleStruct> listOfStructs;
private final List<Map<String, String>> listOfMapOfEnumToString;
private final List<Map<String, SimpleStruct>> listOfMapOfStringToStruct;
private final Map<String, List<Integer>> mapOfStringToIntegerList;
private final Map<String, String> mapOfStringToString;
private final Map<String, SimpleStruct> mapOfStringToSimpleStruct;
private final Map<String, String> mapOfEnumToEnum;
private final Map<String, String> mapOfEnumToString;
private final Map<String, String> mapOfStringToEnum;
private final Map<String, SimpleStruct> mapOfEnumToSimpleStruct;
private final Map<String, List<String>> mapOfEnumToListOfEnums;
private final Map<String, Map<String, String>> mapOfEnumToMapOfStringToEnum;
private final Instant timestampMember;
private final StructWithTimestamp structWithNestedTimestampMember;
private final SdkBytes blobArg;
private final StructWithNestedBlobType structWithNestedBlob;
private final Map<String, SdkBytes> blobMap;
private final List<SdkBytes> listOfBlobs;
private final RecursiveStructType recursiveStruct;
private final BaseType polymorphicTypeWithSubTypes;
private final SubTypeOne polymorphicTypeWithoutSubTypes;
private final String enumType;
private final Underscore_Name_Type underscore_Name_Type;
private final Document myDocument;
private final AllTypesUnionStructure allTypesUnionStructure;
private final Type type;
private AllTypesUnionStructure(BuilderImpl builder) {
this.stringMember = builder.stringMember;
this.integerMember = builder.integerMember;
this.booleanMember = builder.booleanMember;
this.floatMember = builder.floatMember;
this.doubleMember = builder.doubleMember;
this.longMember = builder.longMember;
this.shortMember = builder.shortMember;
this.simpleList = builder.simpleList;
this.listOfEnums = builder.listOfEnums;
this.listOfMaps = builder.listOfMaps;
this.listOfStructs = builder.listOfStructs;
this.listOfMapOfEnumToString = builder.listOfMapOfEnumToString;
this.listOfMapOfStringToStruct = builder.listOfMapOfStringToStruct;
this.mapOfStringToIntegerList = builder.mapOfStringToIntegerList;
this.mapOfStringToString = builder.mapOfStringToString;
this.mapOfStringToSimpleStruct = builder.mapOfStringToSimpleStruct;
this.mapOfEnumToEnum = builder.mapOfEnumToEnum;
this.mapOfEnumToString = builder.mapOfEnumToString;
this.mapOfStringToEnum = builder.mapOfStringToEnum;
this.mapOfEnumToSimpleStruct = builder.mapOfEnumToSimpleStruct;
this.mapOfEnumToListOfEnums = builder.mapOfEnumToListOfEnums;
this.mapOfEnumToMapOfStringToEnum = builder.mapOfEnumToMapOfStringToEnum;
this.timestampMember = builder.timestampMember;
this.structWithNestedTimestampMember = builder.structWithNestedTimestampMember;
this.blobArg = builder.blobArg;
this.structWithNestedBlob = builder.structWithNestedBlob;
this.blobMap = builder.blobMap;
this.listOfBlobs = builder.listOfBlobs;
this.recursiveStruct = builder.recursiveStruct;
this.polymorphicTypeWithSubTypes = builder.polymorphicTypeWithSubTypes;
this.polymorphicTypeWithoutSubTypes = builder.polymorphicTypeWithoutSubTypes;
this.enumType = builder.enumType;
this.underscore_Name_Type = builder.underscore_Name_Type;
this.myDocument = builder.myDocument;
this.allTypesUnionStructure = builder.allTypesUnionStructure;
this.type = builder.type;
}
/**
* Returns the value of the StringMember property for this object.
*
* @return The value of the StringMember property for this object.
*/
public final String stringMember() {
return stringMember;
}
/**
* Returns the value of the IntegerMember property for this object.
*
* @return The value of the IntegerMember property for this object.
*/
public final Integer integerMember() {
return integerMember;
}
/**
* Returns the value of the BooleanMember property for this object.
*
* @return The value of the BooleanMember property for this object.
*/
public final Boolean booleanMember() {
return booleanMember;
}
/**
* Returns the value of the FloatMember property for this object.
*
* @return The value of the FloatMember property for this object.
*/
public final Float floatMember() {
return floatMember;
}
/**
* Returns the value of the DoubleMember property for this object.
*
* @return The value of the DoubleMember property for this object.
*/
public final Double doubleMember() {
return doubleMember;
}
/**
* Returns the value of the LongMember property for this object.
*
* @return The value of the LongMember property for this object.
*/
public final Long longMember() {
return longMember;
}
/**
* Returns the value of the ShortMember property for this object.
*
* @return The value of the ShortMember property for this object.
*/
public final Short shortMember() {
return shortMember;
}
/**
* For responses, this returns true if the service returned a value for the SimpleList property. This DOES NOT check
* that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is
* useful because the SDK will never return a null collection or map, but you may need to differentiate between the
* service returning nothing (or null) and the service returning an empty collection or map. For requests, this
* returns true if a value for the property was specified in the request builder, and false if a value was not
* specified.
*/
public final boolean hasSimpleList() {
return simpleList != null && !(simpleList instanceof SdkAutoConstructList);
}
/**
* Returns the value of the SimpleList property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasSimpleList} method.
* </p>
*
* @return The value of the SimpleList property for this object.
*/
public final List<String> simpleList() {
return simpleList;
}
/**
* Returns the value of the ListOfEnums property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasListOfEnums} method.
* </p>
*
* @return The value of the ListOfEnums property for this object.
*/
public final List<EnumType> listOfEnums() {
return ListOfEnumsCopier.copyStringToEnum(listOfEnums);
}
/**
* For responses, this returns true if the service returned a value for the ListOfEnums property. This DOES NOT
* check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property).
* This is useful because the SDK will never return a null collection or map, but you may need to differentiate
* between the service returning nothing (or null) and the service returning an empty collection or map. For
* requests, this returns true if a value for the property was specified in the request builder, and false if a
* value was not specified.
*/
public final boolean hasListOfEnums() {
return listOfEnums != null && !(listOfEnums instanceof SdkAutoConstructList);
}
/**
* Returns the value of the ListOfEnums property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasListOfEnums} method.
* </p>
*
* @return The value of the ListOfEnums property for this object.
*/
public final List<String> listOfEnumsAsStrings() {
return listOfEnums;
}
/**
* For responses, this returns true if the service returned a value for the ListOfMaps property. This DOES NOT check
* that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is
* useful because the SDK will never return a null collection or map, but you may need to differentiate between the
* service returning nothing (or null) and the service returning an empty collection or map. For requests, this
* returns true if a value for the property was specified in the request builder, and false if a value was not
* specified.
*/
public final boolean hasListOfMaps() {
return listOfMaps != null && !(listOfMaps instanceof SdkAutoConstructList);
}
/**
* Returns the value of the ListOfMaps property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasListOfMaps} method.
* </p>
*
* @return The value of the ListOfMaps property for this object.
*/
public final List<Map<String, String>> listOfMaps() {
return listOfMaps;
}
/**
* For responses, this returns true if the service returned a value for the ListOfStructs property. This DOES NOT
* check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property).
* This is useful because the SDK will never return a null collection or map, but you may need to differentiate
* between the service returning nothing (or null) and the service returning an empty collection or map. For
* requests, this returns true if a value for the property was specified in the request builder, and false if a
* value was not specified.
*/
public final boolean hasListOfStructs() {
return listOfStructs != null && !(listOfStructs instanceof SdkAutoConstructList);
}
/**
* Returns the value of the ListOfStructs property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasListOfStructs} method.
* </p>
*
* @return The value of the ListOfStructs property for this object.
*/
public final List<SimpleStruct> listOfStructs() {
return listOfStructs;
}
/**
* Returns the value of the ListOfMapOfEnumToString property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasListOfMapOfEnumToString} method.
* </p>
*
* @return The value of the ListOfMapOfEnumToString property for this object.
*/
public final List<Map<EnumType, String>> listOfMapOfEnumToString() {
return ListOfMapOfEnumToStringCopier.copyStringToEnum(listOfMapOfEnumToString);
}
/**
* For responses, this returns true if the service returned a value for the ListOfMapOfEnumToString property. This
* DOES NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the
* property). This is useful because the SDK will never return a null collection or map, but you may need to
* differentiate between the service returning nothing (or null) and the service returning an empty collection or
* map. For requests, this returns true if a value for the property was specified in the request builder, and false
* if a value was not specified.
*/
public final boolean hasListOfMapOfEnumToString() {
return listOfMapOfEnumToString != null && !(listOfMapOfEnumToString instanceof SdkAutoConstructList);
}
/**
* Returns the value of the ListOfMapOfEnumToString property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasListOfMapOfEnumToString} method.
* </p>
*
* @return The value of the ListOfMapOfEnumToString property for this object.
*/
public final List<Map<String, String>> listOfMapOfEnumToStringAsStrings() {
return listOfMapOfEnumToString;
}
/**
* For responses, this returns true if the service returned a value for the ListOfMapOfStringToStruct property. This
* DOES NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the
* property). This is useful because the SDK will never return a null collection or map, but you may need to
* differentiate between the service returning nothing (or null) and the service returning an empty collection or
* map. For requests, this returns true if a value for the property was specified in the request builder, and false
* if a value was not specified.
*/
public final boolean hasListOfMapOfStringToStruct() {
return listOfMapOfStringToStruct != null && !(listOfMapOfStringToStruct instanceof SdkAutoConstructList);
}
/**
* Returns the value of the ListOfMapOfStringToStruct property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasListOfMapOfStringToStruct} method.
* </p>
*
* @return The value of the ListOfMapOfStringToStruct property for this object.
*/
public final List<Map<String, SimpleStruct>> listOfMapOfStringToStruct() {
return listOfMapOfStringToStruct;
}
/**
* For responses, this returns true if the service returned a value for the MapOfStringToIntegerList property. This
* DOES NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the
* property). This is useful because the SDK will never return a null collection or map, but you may need to
* differentiate between the service returning nothing (or null) and the service returning an empty collection or
* map. For requests, this returns true if a value for the property was specified in the request builder, and false
* if a value was not specified.
*/
public final boolean hasMapOfStringToIntegerList() {
return mapOfStringToIntegerList != null && !(mapOfStringToIntegerList instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the MapOfStringToIntegerList property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasMapOfStringToIntegerList} method.
* </p>
*
* @return The value of the MapOfStringToIntegerList property for this object.
*/
public final Map<String, List<Integer>> mapOfStringToIntegerList() {
return mapOfStringToIntegerList;
}
/**
* For responses, this returns true if the service returned a value for the MapOfStringToString property. This DOES
* NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property).
* This is useful because the SDK will never return a null collection or map, but you may need to differentiate
* between the service returning nothing (or null) and the service returning an empty collection or map. For
* requests, this returns true if a value for the property was specified in the request builder, and false if a
* value was not specified.
*/
public final boolean hasMapOfStringToString() {
return mapOfStringToString != null && !(mapOfStringToString instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the MapOfStringToString property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasMapOfStringToString} method.
* </p>
*
* @return The value of the MapOfStringToString property for this object.
*/
public final Map<String, String> mapOfStringToString() {
return mapOfStringToString;
}
/**
* For responses, this returns true if the service returned a value for the MapOfStringToSimpleStruct property. This
* DOES NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the
* property). This is useful because the SDK will never return a null collection or map, but you may need to
* differentiate between the service returning nothing (or null) and the service returning an empty collection or
* map. For requests, this returns true if a value for the property was specified in the request builder, and false
* if a value was not specified.
*/
public final boolean hasMapOfStringToSimpleStruct() {
return mapOfStringToSimpleStruct != null && !(mapOfStringToSimpleStruct instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the MapOfStringToSimpleStruct property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasMapOfStringToSimpleStruct} method.
* </p>
*
* @return The value of the MapOfStringToSimpleStruct property for this object.
*/
public final Map<String, SimpleStruct> mapOfStringToSimpleStruct() {
return mapOfStringToSimpleStruct;
}
/**
* Returns the value of the MapOfEnumToEnum property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasMapOfEnumToEnum} method.
* </p>
*
* @return The value of the MapOfEnumToEnum property for this object.
*/
public final Map<EnumType, EnumType> mapOfEnumToEnum() {
return MapOfEnumToEnumCopier.copyStringToEnum(mapOfEnumToEnum);
}
/**
* For responses, this returns true if the service returned a value for the MapOfEnumToEnum property. This DOES NOT
* check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property).
* This is useful because the SDK will never return a null collection or map, but you may need to differentiate
* between the service returning nothing (or null) and the service returning an empty collection or map. For
* requests, this returns true if a value for the property was specified in the request builder, and false if a
* value was not specified.
*/
public final boolean hasMapOfEnumToEnum() {
return mapOfEnumToEnum != null && !(mapOfEnumToEnum instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the MapOfEnumToEnum property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasMapOfEnumToEnum} method.
* </p>
*
* @return The value of the MapOfEnumToEnum property for this object.
*/
public final Map<String, String> mapOfEnumToEnumAsStrings() {
return mapOfEnumToEnum;
}
/**
* Returns the value of the MapOfEnumToString property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasMapOfEnumToString} method.
* </p>
*
* @return The value of the MapOfEnumToString property for this object.
*/
public final Map<EnumType, String> mapOfEnumToString() {
return MapOfEnumToStringCopier.copyStringToEnum(mapOfEnumToString);
}
/**
* For responses, this returns true if the service returned a value for the MapOfEnumToString property. This DOES
* NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property).
* This is useful because the SDK will never return a null collection or map, but you may need to differentiate
* between the service returning nothing (or null) and the service returning an empty collection or map. For
* requests, this returns true if a value for the property was specified in the request builder, and false if a
* value was not specified.
*/
public final boolean hasMapOfEnumToString() {
return mapOfEnumToString != null && !(mapOfEnumToString instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the MapOfEnumToString property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasMapOfEnumToString} method.
* </p>
*
* @return The value of the MapOfEnumToString property for this object.
*/
public final Map<String, String> mapOfEnumToStringAsStrings() {
return mapOfEnumToString;
}
/**
* Returns the value of the MapOfStringToEnum property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasMapOfStringToEnum} method.
* </p>
*
* @return The value of the MapOfStringToEnum property for this object.
*/
public final Map<String, EnumType> mapOfStringToEnum() {
return MapOfStringToEnumCopier.copyStringToEnum(mapOfStringToEnum);
}
/**
* For responses, this returns true if the service returned a value for the MapOfStringToEnum property. This DOES
* NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property).
* This is useful because the SDK will never return a null collection or map, but you may need to differentiate
* between the service returning nothing (or null) and the service returning an empty collection or map. For
* requests, this returns true if a value for the property was specified in the request builder, and false if a
* value was not specified.
*/
public final boolean hasMapOfStringToEnum() {
return mapOfStringToEnum != null && !(mapOfStringToEnum instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the MapOfStringToEnum property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasMapOfStringToEnum} method.
* </p>
*
* @return The value of the MapOfStringToEnum property for this object.
*/
public final Map<String, String> mapOfStringToEnumAsStrings() {
return mapOfStringToEnum;
}
/**
* Returns the value of the MapOfEnumToSimpleStruct property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasMapOfEnumToSimpleStruct} method.
* </p>
*
* @return The value of the MapOfEnumToSimpleStruct property for this object.
*/
public final Map<EnumType, SimpleStruct> mapOfEnumToSimpleStruct() {
return MapOfEnumToSimpleStructCopier.copyStringToEnum(mapOfEnumToSimpleStruct);
}
/**
* For responses, this returns true if the service returned a value for the MapOfEnumToSimpleStruct property. This
* DOES NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the
* property). This is useful because the SDK will never return a null collection or map, but you may need to
* differentiate between the service returning nothing (or null) and the service returning an empty collection or
* map. For requests, this returns true if a value for the property was specified in the request builder, and false
* if a value was not specified.
*/
public final boolean hasMapOfEnumToSimpleStruct() {
return mapOfEnumToSimpleStruct != null && !(mapOfEnumToSimpleStruct instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the MapOfEnumToSimpleStruct property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasMapOfEnumToSimpleStruct} method.
* </p>
*
* @return The value of the MapOfEnumToSimpleStruct property for this object.
*/
public final Map<String, SimpleStruct> mapOfEnumToSimpleStructAsStrings() {
return mapOfEnumToSimpleStruct;
}
/**
* Returns the value of the MapOfEnumToListOfEnums property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasMapOfEnumToListOfEnums} method.
* </p>
*
* @return The value of the MapOfEnumToListOfEnums property for this object.
*/
public final Map<EnumType, List<EnumType>> mapOfEnumToListOfEnums() {
return MapOfEnumToListOfEnumsCopier.copyStringToEnum(mapOfEnumToListOfEnums);
}
/**
* For responses, this returns true if the service returned a value for the MapOfEnumToListOfEnums property. This
* DOES NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the
* property). This is useful because the SDK will never return a null collection or map, but you may need to
* differentiate between the service returning nothing (or null) and the service returning an empty collection or
* map. For requests, this returns true if a value for the property was specified in the request builder, and false
* if a value was not specified.
*/
public final boolean hasMapOfEnumToListOfEnums() {
return mapOfEnumToListOfEnums != null && !(mapOfEnumToListOfEnums instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the MapOfEnumToListOfEnums property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasMapOfEnumToListOfEnums} method.
* </p>
*
* @return The value of the MapOfEnumToListOfEnums property for this object.
*/
public final Map<String, List<String>> mapOfEnumToListOfEnumsAsStrings() {
return mapOfEnumToListOfEnums;
}
/**
* Returns the value of the MapOfEnumToMapOfStringToEnum property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasMapOfEnumToMapOfStringToEnum} method.
* </p>
*
* @return The value of the MapOfEnumToMapOfStringToEnum property for this object.
*/
public final Map<EnumType, Map<String, EnumType>> mapOfEnumToMapOfStringToEnum() {
return MapOfEnumToMapOfStringToEnumCopier.copyStringToEnum(mapOfEnumToMapOfStringToEnum);
}
/**
* For responses, this returns true if the service returned a value for the MapOfEnumToMapOfStringToEnum property.
* This DOES NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the
* property). This is useful because the SDK will never return a null collection or map, but you may need to
* differentiate between the service returning nothing (or null) and the service returning an empty collection or
* map. For requests, this returns true if a value for the property was specified in the request builder, and false
* if a value was not specified.
*/
public final boolean hasMapOfEnumToMapOfStringToEnum() {
return mapOfEnumToMapOfStringToEnum != null && !(mapOfEnumToMapOfStringToEnum instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the MapOfEnumToMapOfStringToEnum property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasMapOfEnumToMapOfStringToEnum} method.
* </p>
*
* @return The value of the MapOfEnumToMapOfStringToEnum property for this object.
*/
public final Map<String, Map<String, String>> mapOfEnumToMapOfStringToEnumAsStrings() {
return mapOfEnumToMapOfStringToEnum;
}
/**
* Returns the value of the TimestampMember property for this object.
*
* @return The value of the TimestampMember property for this object.
*/
public final Instant timestampMember() {
return timestampMember;
}
/**
* Returns the value of the StructWithNestedTimestampMember property for this object.
*
* @return The value of the StructWithNestedTimestampMember property for this object.
*/
public final StructWithTimestamp structWithNestedTimestampMember() {
return structWithNestedTimestampMember;
}
/**
* Returns the value of the BlobArg property for this object.
*
* @return The value of the BlobArg property for this object.
*/
public final SdkBytes blobArg() {
return blobArg;
}
/**
* Returns the value of the StructWithNestedBlob property for this object.
*
* @return The value of the StructWithNestedBlob property for this object.
*/
public final StructWithNestedBlobType structWithNestedBlob() {
return structWithNestedBlob;
}
/**
* For responses, this returns true if the service returned a value for the BlobMap property. This DOES NOT check
* that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is
* useful because the SDK will never return a null collection or map, but you may need to differentiate between the
* service returning nothing (or null) and the service returning an empty collection or map. For requests, this
* returns true if a value for the property was specified in the request builder, and false if a value was not
* specified.
*/
public final boolean hasBlobMap() {
return blobMap != null && !(blobMap instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the BlobMap property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasBlobMap} method.
* </p>
*
* @return The value of the BlobMap property for this object.
*/
public final Map<String, SdkBytes> blobMap() {
return blobMap;
}
/**
* For responses, this returns true if the service returned a value for the ListOfBlobs property. This DOES NOT
* check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property).
* This is useful because the SDK will never return a null collection or map, but you may need to differentiate
* between the service returning nothing (or null) and the service returning an empty collection or map. For
* requests, this returns true if a value for the property was specified in the request builder, and false if a
* value was not specified.
*/
public final boolean hasListOfBlobs() {
return listOfBlobs != null && !(listOfBlobs instanceof SdkAutoConstructList);
}
/**
* Returns the value of the ListOfBlobs property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasListOfBlobs} method.
* </p>
*
* @return The value of the ListOfBlobs property for this object.
*/
public final List<SdkBytes> listOfBlobs() {
return listOfBlobs;
}
/**
* Returns the value of the RecursiveStruct property for this object.
*
* @return The value of the RecursiveStruct property for this object.
*/
public final RecursiveStructType recursiveStruct() {
return recursiveStruct;
}
/**
* Returns the value of the PolymorphicTypeWithSubTypes property for this object.
*
* @return The value of the PolymorphicTypeWithSubTypes property for this object.
*/
public final BaseType polymorphicTypeWithSubTypes() {
return polymorphicTypeWithSubTypes;
}
/**
* Returns the value of the PolymorphicTypeWithoutSubTypes property for this object.
*
* @return The value of the PolymorphicTypeWithoutSubTypes property for this object.
*/
public final SubTypeOne polymorphicTypeWithoutSubTypes() {
return polymorphicTypeWithoutSubTypes;
}
/**
* Returns the value of the EnumType property for this object.
* <p>
* If the service returns an enum value that is not available in the current SDK version, {@link #enumType} will
* return {@link EnumType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #enumTypeAsString}.
* </p>
*
* @return The value of the EnumType property for this object.
* @see EnumType
*/
public final EnumType enumType() {
return EnumType.fromValue(enumType);
}
/**
* Returns the value of the EnumType property for this object.
* <p>
* If the service returns an enum value that is not available in the current SDK version, {@link #enumType} will
* return {@link EnumType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #enumTypeAsString}.
* </p>
*
* @return The value of the EnumType property for this object.
* @see EnumType
*/
public final String enumTypeAsString() {
return enumType;
}
/**
* Returns the value of the Underscore_Name_Type property for this object.
*
* @return The value of the Underscore_Name_Type property for this object.
*/
public final Underscore_Name_Type underscore_Name_Type() {
return underscore_Name_Type;
}
/**
* Returns the value of the MyDocument property for this object.
*
* @return The value of the MyDocument property for this object.
*/
public final Document myDocument() {
return myDocument;
}
/**
* Returns the value of the AllTypesUnionStructure property for this object.
*
* @return The value of the AllTypesUnionStructure property for this object.
*/
public final AllTypesUnionStructure allTypesUnionStructure() {
return allTypesUnionStructure;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class<? extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(stringMember());
hashCode = 31 * hashCode + Objects.hashCode(integerMember());
hashCode = 31 * hashCode + Objects.hashCode(booleanMember());
hashCode = 31 * hashCode + Objects.hashCode(floatMember());
hashCode = 31 * hashCode + Objects.hashCode(doubleMember());
hashCode = 31 * hashCode + Objects.hashCode(longMember());
hashCode = 31 * hashCode + Objects.hashCode(shortMember());
hashCode = 31 * hashCode + Objects.hashCode(hasSimpleList() ? simpleList() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasListOfEnums() ? listOfEnumsAsStrings() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasListOfMaps() ? listOfMaps() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasListOfStructs() ? listOfStructs() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasListOfMapOfEnumToString() ? listOfMapOfEnumToStringAsStrings() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasListOfMapOfStringToStruct() ? listOfMapOfStringToStruct() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasMapOfStringToIntegerList() ? mapOfStringToIntegerList() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasMapOfStringToString() ? mapOfStringToString() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasMapOfStringToSimpleStruct() ? mapOfStringToSimpleStruct() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasMapOfEnumToEnum() ? mapOfEnumToEnumAsStrings() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasMapOfEnumToString() ? mapOfEnumToStringAsStrings() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasMapOfStringToEnum() ? mapOfStringToEnumAsStrings() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasMapOfEnumToSimpleStruct() ? mapOfEnumToSimpleStructAsStrings() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasMapOfEnumToListOfEnums() ? mapOfEnumToListOfEnumsAsStrings() : null);
hashCode = 31 * hashCode
+ Objects.hashCode(hasMapOfEnumToMapOfStringToEnum() ? mapOfEnumToMapOfStringToEnumAsStrings() : null);
hashCode = 31 * hashCode + Objects.hashCode(timestampMember());
hashCode = 31 * hashCode + Objects.hashCode(structWithNestedTimestampMember());
hashCode = 31 * hashCode + Objects.hashCode(blobArg());
hashCode = 31 * hashCode + Objects.hashCode(structWithNestedBlob());
hashCode = 31 * hashCode + Objects.hashCode(hasBlobMap() ? blobMap() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasListOfBlobs() ? listOfBlobs() : null);
hashCode = 31 * hashCode + Objects.hashCode(recursiveStruct());
hashCode = 31 * hashCode + Objects.hashCode(polymorphicTypeWithSubTypes());
hashCode = 31 * hashCode + Objects.hashCode(polymorphicTypeWithoutSubTypes());
hashCode = 31 * hashCode + Objects.hashCode(enumTypeAsString());
hashCode = 31 * hashCode + Objects.hashCode(underscore_Name_Type());
hashCode = 31 * hashCode + Objects.hashCode(myDocument());
hashCode = 31 * hashCode + Objects.hashCode(allTypesUnionStructure());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof AllTypesUnionStructure)) {
return false;
}
AllTypesUnionStructure other = (AllTypesUnionStructure) obj;
return Objects.equals(stringMember(), other.stringMember()) && Objects.equals(integerMember(), other.integerMember())
&& Objects.equals(booleanMember(), other.booleanMember()) && Objects.equals(floatMember(), other.floatMember())
&& Objects.equals(doubleMember(), other.doubleMember()) && Objects.equals(longMember(), other.longMember())
&& Objects.equals(shortMember(), other.shortMember()) && hasSimpleList() == other.hasSimpleList()
&& Objects.equals(simpleList(), other.simpleList()) && hasListOfEnums() == other.hasListOfEnums()
&& Objects.equals(listOfEnumsAsStrings(), other.listOfEnumsAsStrings())
&& hasListOfMaps() == other.hasListOfMaps() && Objects.equals(listOfMaps(), other.listOfMaps())
&& hasListOfStructs() == other.hasListOfStructs() && Objects.equals(listOfStructs(), other.listOfStructs())
&& hasListOfMapOfEnumToString() == other.hasListOfMapOfEnumToString()
&& Objects.equals(listOfMapOfEnumToStringAsStrings(), other.listOfMapOfEnumToStringAsStrings())
&& hasListOfMapOfStringToStruct() == other.hasListOfMapOfStringToStruct()
&& Objects.equals(listOfMapOfStringToStruct(), other.listOfMapOfStringToStruct())
&& hasMapOfStringToIntegerList() == other.hasMapOfStringToIntegerList()
&& Objects.equals(mapOfStringToIntegerList(), other.mapOfStringToIntegerList())
&& hasMapOfStringToString() == other.hasMapOfStringToString()
&& Objects.equals(mapOfStringToString(), other.mapOfStringToString())
&& hasMapOfStringToSimpleStruct() == other.hasMapOfStringToSimpleStruct()
&& Objects.equals(mapOfStringToSimpleStruct(), other.mapOfStringToSimpleStruct())
&& hasMapOfEnumToEnum() == other.hasMapOfEnumToEnum()
&& Objects.equals(mapOfEnumToEnumAsStrings(), other.mapOfEnumToEnumAsStrings())
&& hasMapOfEnumToString() == other.hasMapOfEnumToString()
&& Objects.equals(mapOfEnumToStringAsStrings(), other.mapOfEnumToStringAsStrings())
&& hasMapOfStringToEnum() == other.hasMapOfStringToEnum()
&& Objects.equals(mapOfStringToEnumAsStrings(), other.mapOfStringToEnumAsStrings())
&& hasMapOfEnumToSimpleStruct() == other.hasMapOfEnumToSimpleStruct()
&& Objects.equals(mapOfEnumToSimpleStructAsStrings(), other.mapOfEnumToSimpleStructAsStrings())
&& hasMapOfEnumToListOfEnums() == other.hasMapOfEnumToListOfEnums()
&& Objects.equals(mapOfEnumToListOfEnumsAsStrings(), other.mapOfEnumToListOfEnumsAsStrings())
&& hasMapOfEnumToMapOfStringToEnum() == other.hasMapOfEnumToMapOfStringToEnum()
&& Objects.equals(mapOfEnumToMapOfStringToEnumAsStrings(), other.mapOfEnumToMapOfStringToEnumAsStrings())
&& Objects.equals(timestampMember(), other.timestampMember())
&& Objects.equals(structWithNestedTimestampMember(), other.structWithNestedTimestampMember())
&& Objects.equals(blobArg(), other.blobArg())
&& Objects.equals(structWithNestedBlob(), other.structWithNestedBlob()) && hasBlobMap() == other.hasBlobMap()
&& Objects.equals(blobMap(), other.blobMap()) && hasListOfBlobs() == other.hasListOfBlobs()
&& Objects.equals(listOfBlobs(), other.listOfBlobs())
&& Objects.equals(recursiveStruct(), other.recursiveStruct())
&& Objects.equals(polymorphicTypeWithSubTypes(), other.polymorphicTypeWithSubTypes())
&& Objects.equals(polymorphicTypeWithoutSubTypes(), other.polymorphicTypeWithoutSubTypes())
&& Objects.equals(enumTypeAsString(), other.enumTypeAsString())
&& Objects.equals(underscore_Name_Type(), other.underscore_Name_Type())
&& Objects.equals(myDocument(), other.myDocument())
&& Objects.equals(allTypesUnionStructure(), other.allTypesUnionStructure());
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString
.builder("AllTypesUnionStructure")
.add("StringMember", stringMember())
.add("IntegerMember", integerMember())
.add("BooleanMember", booleanMember())
.add("FloatMember", floatMember())
.add("DoubleMember", doubleMember())
.add("LongMember", longMember())
.add("ShortMember", shortMember())
.add("SimpleList", hasSimpleList() ? simpleList() : null)
.add("ListOfEnums", hasListOfEnums() ? listOfEnumsAsStrings() : null)
.add("ListOfMaps", hasListOfMaps() ? listOfMaps() : null)
.add("ListOfStructs", hasListOfStructs() ? listOfStructs() : null)
.add("ListOfMapOfEnumToString", hasListOfMapOfEnumToString() ? listOfMapOfEnumToStringAsStrings() : null)
.add("ListOfMapOfStringToStruct", hasListOfMapOfStringToStruct() ? listOfMapOfStringToStruct() : null)
.add("MapOfStringToIntegerList", hasMapOfStringToIntegerList() ? mapOfStringToIntegerList() : null)
.add("MapOfStringToString", hasMapOfStringToString() ? mapOfStringToString() : null)
.add("MapOfStringToSimpleStruct", hasMapOfStringToSimpleStruct() ? mapOfStringToSimpleStruct() : null)
.add("MapOfEnumToEnum", hasMapOfEnumToEnum() ? mapOfEnumToEnumAsStrings() : null)
.add("MapOfEnumToString", hasMapOfEnumToString() ? mapOfEnumToStringAsStrings() : null)
.add("MapOfStringToEnum", hasMapOfStringToEnum() ? mapOfStringToEnumAsStrings() : null)
.add("MapOfEnumToSimpleStruct", hasMapOfEnumToSimpleStruct() ? mapOfEnumToSimpleStructAsStrings() : null)
.add("MapOfEnumToListOfEnums", hasMapOfEnumToListOfEnums() ? mapOfEnumToListOfEnumsAsStrings() : null)
.add("MapOfEnumToMapOfStringToEnum",
hasMapOfEnumToMapOfStringToEnum() ? mapOfEnumToMapOfStringToEnumAsStrings() : null)
.add("TimestampMember", timestampMember())
.add("StructWithNestedTimestampMember", structWithNestedTimestampMember()).add("BlobArg", blobArg())
.add("StructWithNestedBlob", structWithNestedBlob()).add("BlobMap", hasBlobMap() ? blobMap() : null)
.add("ListOfBlobs", hasListOfBlobs() ? listOfBlobs() : null).add("RecursiveStruct", recursiveStruct())
.add("PolymorphicTypeWithSubTypes", polymorphicTypeWithSubTypes())
.add("PolymorphicTypeWithoutSubTypes", polymorphicTypeWithoutSubTypes()).add("EnumType", enumTypeAsString())
.add("Underscore_Name_Type", underscore_Name_Type()).add("MyDocument", myDocument())
.add("AllTypesUnionStructure", allTypesUnionStructure()).build();
}
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
switch (fieldName) {
case "StringMember":
return Optional.ofNullable(clazz.cast(stringMember()));
case "IntegerMember":
return Optional.ofNullable(clazz.cast(integerMember()));
case "BooleanMember":
return Optional.ofNullable(clazz.cast(booleanMember()));
case "FloatMember":
return Optional.ofNullable(clazz.cast(floatMember()));
case "DoubleMember":
return Optional.ofNullable(clazz.cast(doubleMember()));
case "LongMember":
return Optional.ofNullable(clazz.cast(longMember()));
case "ShortMember":
return Optional.ofNullable(clazz.cast(shortMember()));
case "SimpleList":
return Optional.ofNullable(clazz.cast(simpleList()));
case "ListOfEnums":
return Optional.ofNullable(clazz.cast(listOfEnumsAsStrings()));
case "ListOfMaps":
return Optional.ofNullable(clazz.cast(listOfMaps()));
case "ListOfStructs":
return Optional.ofNullable(clazz.cast(listOfStructs()));
case "ListOfMapOfEnumToString":
return Optional.ofNullable(clazz.cast(listOfMapOfEnumToStringAsStrings()));
case "ListOfMapOfStringToStruct":
return Optional.ofNullable(clazz.cast(listOfMapOfStringToStruct()));
case "MapOfStringToIntegerList":
return Optional.ofNullable(clazz.cast(mapOfStringToIntegerList()));
case "MapOfStringToString":
return Optional.ofNullable(clazz.cast(mapOfStringToString()));
case "MapOfStringToSimpleStruct":
return Optional.ofNullable(clazz.cast(mapOfStringToSimpleStruct()));
case "MapOfEnumToEnum":
return Optional.ofNullable(clazz.cast(mapOfEnumToEnumAsStrings()));
case "MapOfEnumToString":
return Optional.ofNullable(clazz.cast(mapOfEnumToStringAsStrings()));
case "MapOfStringToEnum":
return Optional.ofNullable(clazz.cast(mapOfStringToEnumAsStrings()));
case "MapOfEnumToSimpleStruct":
return Optional.ofNullable(clazz.cast(mapOfEnumToSimpleStructAsStrings()));
case "MapOfEnumToListOfEnums":
return Optional.ofNullable(clazz.cast(mapOfEnumToListOfEnumsAsStrings()));
case "MapOfEnumToMapOfStringToEnum":
return Optional.ofNullable(clazz.cast(mapOfEnumToMapOfStringToEnumAsStrings()));
case "TimestampMember":
return Optional.ofNullable(clazz.cast(timestampMember()));
case "StructWithNestedTimestampMember":
return Optional.ofNullable(clazz.cast(structWithNestedTimestampMember()));
case "BlobArg":
return Optional.ofNullable(clazz.cast(blobArg()));
case "StructWithNestedBlob":
return Optional.ofNullable(clazz.cast(structWithNestedBlob()));
case "BlobMap":
return Optional.ofNullable(clazz.cast(blobMap()));
case "ListOfBlobs":
return Optional.ofNullable(clazz.cast(listOfBlobs()));
case "RecursiveStruct":
return Optional.ofNullable(clazz.cast(recursiveStruct()));
case "PolymorphicTypeWithSubTypes":
return Optional.ofNullable(clazz.cast(polymorphicTypeWithSubTypes()));
case "PolymorphicTypeWithoutSubTypes":
return Optional.ofNullable(clazz.cast(polymorphicTypeWithoutSubTypes()));
case "EnumType":
return Optional.ofNullable(clazz.cast(enumTypeAsString()));
case "Underscore_Name_Type":
return Optional.ofNullable(clazz.cast(underscore_Name_Type()));
case "MyDocument":
return Optional.ofNullable(clazz.cast(myDocument()));
case "AllTypesUnionStructure":
return Optional.ofNullable(clazz.cast(allTypesUnionStructure()));
default:
return Optional.empty();
}
}
/**
* Create an instance of this class with {@link #stringMember()} initialized to the given value.
*
* Sets the value of the StringMember property for this object.
*
* @param stringMember
* The new value for the StringMember property for this object.
*/
public static AllTypesUnionStructure fromStringMember(String stringMember) {
return builder().stringMember(stringMember).build();
}
/**
* Create an instance of this class with {@link #integerMember()} initialized to the given value.
*
* Sets the value of the IntegerMember property for this object.
*
* @param integerMember
* The new value for the IntegerMember property for this object.
*/
public static AllTypesUnionStructure fromIntegerMember(Integer integerMember) {
return builder().integerMember(integerMember).build();
}
/**
* Create an instance of this class with {@link #booleanMember()} initialized to the given value.
*
* Sets the value of the BooleanMember property for this object.
*
* @param booleanMember
* The new value for the BooleanMember property for this object.
*/
public static AllTypesUnionStructure fromBooleanMember(Boolean booleanMember) {
return builder().booleanMember(booleanMember).build();
}
/**
* Create an instance of this class with {@link #floatMember()} initialized to the given value.
*
* Sets the value of the FloatMember property for this object.
*
* @param floatMember
* The new value for the FloatMember property for this object.
*/
public static AllTypesUnionStructure fromFloatMember(Float floatMember) {
return builder().floatMember(floatMember).build();
}
/**
* Create an instance of this class with {@link #doubleMember()} initialized to the given value.
*
* Sets the value of the DoubleMember property for this object.
*
* @param doubleMember
* The new value for the DoubleMember property for this object.
*/
public static AllTypesUnionStructure fromDoubleMember(Double doubleMember) {
return builder().doubleMember(doubleMember).build();
}
/**
* Create an instance of this class with {@link #longMember()} initialized to the given value.
*
* Sets the value of the LongMember property for this object.
*
* @param longMember
* The new value for the LongMember property for this object.
*/
public static AllTypesUnionStructure fromLongMember(Long longMember) {
return builder().longMember(longMember).build();
}
/**
* Create an instance of this class with {@link #shortMember()} initialized to the given value.
*
* Sets the value of the ShortMember property for this object.
*
* @param shortMember
* The new value for the ShortMember property for this object.
*/
public static AllTypesUnionStructure fromShortMember(Short shortMember) {
return builder().shortMember(shortMember).build();
}
/**
* Create an instance of this class with {@link #simpleList()} initialized to the given value.
*
* Sets the value of the SimpleList property for this object.
*
* @param simpleList
* The new value for the SimpleList property for this object.
*/
public static AllTypesUnionStructure fromSimpleList(List<String> simpleList) {
return builder().simpleList(simpleList).build();
}
/**
* Create an instance of this class with {@link #listOfEnumsAsStrings()} initialized to the given value.
*
* Sets the value of the ListOfEnums property for this object.
*
* @param listOfEnums
* The new value for the ListOfEnums property for this object.
*/
public static AllTypesUnionStructure fromListOfEnumsWithStrings(List<String> listOfEnumsWithStrings) {
return builder().listOfEnumsWithStrings(listOfEnumsWithStrings).build();
}
/**
* Create an instance of this class with {@link #listOfEnumsAsStrings()} initialized to the given value.
*
* Sets the value of the ListOfEnums property for this object.
*
* @param listOfEnums
* The new value for the ListOfEnums property for this object.
*/
public static AllTypesUnionStructure fromListOfEnums(List<EnumType> listOfEnumsWithStrings) {
return builder().listOfEnums(listOfEnumsWithStrings).build();
}
/**
* Create an instance of this class with {@link #listOfMaps()} initialized to the given value.
*
* Sets the value of the ListOfMaps property for this object.
*
* @param listOfMaps
* The new value for the ListOfMaps property for this object.
*/
public static AllTypesUnionStructure fromListOfMaps(List<Map<String, String>> listOfMaps) {
return builder().listOfMaps(listOfMaps).build();
}
/**
* Create an instance of this class with {@link #listOfStructs()} initialized to the given value.
*
* Sets the value of the ListOfStructs property for this object.
*
* @param listOfStructs
* The new value for the ListOfStructs property for this object.
*/
public static AllTypesUnionStructure fromListOfStructs(List<SimpleStruct> listOfStructs) {
return builder().listOfStructs(listOfStructs).build();
}
/**
* Create an instance of this class with {@link #listOfMapOfEnumToStringAsStrings()} initialized to the given value.
*
* Sets the value of the ListOfMapOfEnumToString property for this object.
*
* @param listOfMapOfEnumToString
* The new value for the ListOfMapOfEnumToString property for this object.
*/
public static AllTypesUnionStructure fromListOfMapOfEnumToStringWithStrings(
List<Map<String, String>> listOfMapOfEnumToStringWithStrings) {
return builder().listOfMapOfEnumToStringWithStrings(listOfMapOfEnumToStringWithStrings).build();
}
/**
* Create an instance of this class with {@link #listOfMapOfEnumToStringAsStrings()} initialized to the given value.
*
* Sets the value of the ListOfMapOfEnumToString property for this object.
*
* @param listOfMapOfEnumToString
* The new value for the ListOfMapOfEnumToString property for this object.
*/
public static AllTypesUnionStructure fromListOfMapOfEnumToString(
List<Map<EnumType, String>> listOfMapOfEnumToStringWithStrings) {
return builder().listOfMapOfEnumToString(listOfMapOfEnumToStringWithStrings).build();
}
/**
* Create an instance of this class with {@link #listOfMapOfStringToStruct()} initialized to the given value.
*
* Sets the value of the ListOfMapOfStringToStruct property for this object.
*
* @param listOfMapOfStringToStruct
* The new value for the ListOfMapOfStringToStruct property for this object.
*/
public static AllTypesUnionStructure fromListOfMapOfStringToStruct(List<Map<String, SimpleStruct>> listOfMapOfStringToStruct) {
return builder().listOfMapOfStringToStruct(listOfMapOfStringToStruct).build();
}
/**
* Create an instance of this class with {@link #mapOfStringToIntegerList()} initialized to the given value.
*
* Sets the value of the MapOfStringToIntegerList property for this object.
*
* @param mapOfStringToIntegerList
* The new value for the MapOfStringToIntegerList property for this object.
*/
public static AllTypesUnionStructure fromMapOfStringToIntegerList(Map<String, List<Integer>> mapOfStringToIntegerList) {
return builder().mapOfStringToIntegerList(mapOfStringToIntegerList).build();
}
/**
* Create an instance of this class with {@link #mapOfStringToString()} initialized to the given value.
*
* Sets the value of the MapOfStringToString property for this object.
*
* @param mapOfStringToString
* The new value for the MapOfStringToString property for this object.
*/
public static AllTypesUnionStructure fromMapOfStringToString(Map<String, String> mapOfStringToString) {
return builder().mapOfStringToString(mapOfStringToString).build();
}
/**
* Create an instance of this class with {@link #mapOfStringToSimpleStruct()} initialized to the given value.
*
* Sets the value of the MapOfStringToSimpleStruct property for this object.
*
* @param mapOfStringToSimpleStruct
* The new value for the MapOfStringToSimpleStruct property for this object.
*/
public static AllTypesUnionStructure fromMapOfStringToSimpleStruct(Map<String, SimpleStruct> mapOfStringToSimpleStruct) {
return builder().mapOfStringToSimpleStruct(mapOfStringToSimpleStruct).build();
}
/**
* Create an instance of this class with {@link #mapOfEnumToEnumAsStrings()} initialized to the given value.
*
* Sets the value of the MapOfEnumToEnum property for this object.
*
* @param mapOfEnumToEnum
* The new value for the MapOfEnumToEnum property for this object.
*/
public static AllTypesUnionStructure fromMapOfEnumToEnumWithStrings(Map<String, String> mapOfEnumToEnumWithStrings) {
return builder().mapOfEnumToEnumWithStrings(mapOfEnumToEnumWithStrings).build();
}
/**
* Create an instance of this class with {@link #mapOfEnumToEnumAsStrings()} initialized to the given value.
*
* Sets the value of the MapOfEnumToEnum property for this object.
*
* @param mapOfEnumToEnum
* The new value for the MapOfEnumToEnum property for this object.
*/
public static AllTypesUnionStructure fromMapOfEnumToEnum(Map<EnumType, EnumType> mapOfEnumToEnumWithStrings) {
return builder().mapOfEnumToEnum(mapOfEnumToEnumWithStrings).build();
}
/**
* Create an instance of this class with {@link #mapOfEnumToStringAsStrings()} initialized to the given value.
*
* Sets the value of the MapOfEnumToString property for this object.
*
* @param mapOfEnumToString
* The new value for the MapOfEnumToString property for this object.
*/
public static AllTypesUnionStructure fromMapOfEnumToStringWithStrings(Map<String, String> mapOfEnumToStringWithStrings) {
return builder().mapOfEnumToStringWithStrings(mapOfEnumToStringWithStrings).build();
}
/**
* Create an instance of this class with {@link #mapOfEnumToStringAsStrings()} initialized to the given value.
*
* Sets the value of the MapOfEnumToString property for this object.
*
* @param mapOfEnumToString
* The new value for the MapOfEnumToString property for this object.
*/
public static AllTypesUnionStructure fromMapOfEnumToString(Map<EnumType, String> mapOfEnumToStringWithStrings) {
return builder().mapOfEnumToString(mapOfEnumToStringWithStrings).build();
}
/**
* Create an instance of this class with {@link #mapOfStringToEnumAsStrings()} initialized to the given value.
*
* Sets the value of the MapOfStringToEnum property for this object.
*
* @param mapOfStringToEnum
* The new value for the MapOfStringToEnum property for this object.
*/
public static AllTypesUnionStructure fromMapOfStringToEnumWithStrings(Map<String, String> mapOfStringToEnumWithStrings) {
return builder().mapOfStringToEnumWithStrings(mapOfStringToEnumWithStrings).build();
}
/**
* Create an instance of this class with {@link #mapOfStringToEnumAsStrings()} initialized to the given value.
*
* Sets the value of the MapOfStringToEnum property for this object.
*
* @param mapOfStringToEnum
* The new value for the MapOfStringToEnum property for this object.
*/
public static AllTypesUnionStructure fromMapOfStringToEnum(Map<String, EnumType> mapOfStringToEnumWithStrings) {
return builder().mapOfStringToEnum(mapOfStringToEnumWithStrings).build();
}
/**
* Create an instance of this class with {@link #mapOfEnumToSimpleStructAsStrings()} initialized to the given value.
*
* Sets the value of the MapOfEnumToSimpleStruct property for this object.
*
* @param mapOfEnumToSimpleStruct
* The new value for the MapOfEnumToSimpleStruct property for this object.
*/
public static AllTypesUnionStructure fromMapOfEnumToSimpleStructWithStrings(
Map<String, SimpleStruct> mapOfEnumToSimpleStructWithStrings) {
return builder().mapOfEnumToSimpleStructWithStrings(mapOfEnumToSimpleStructWithStrings).build();
}
/**
* Create an instance of this class with {@link #mapOfEnumToSimpleStructAsStrings()} initialized to the given value.
*
* Sets the value of the MapOfEnumToSimpleStruct property for this object.
*
* @param mapOfEnumToSimpleStruct
* The new value for the MapOfEnumToSimpleStruct property for this object.
*/
public static AllTypesUnionStructure fromMapOfEnumToSimpleStruct(
Map<EnumType, SimpleStruct> mapOfEnumToSimpleStructWithStrings) {
return builder().mapOfEnumToSimpleStruct(mapOfEnumToSimpleStructWithStrings).build();
}
/**
* Create an instance of this class with {@link #mapOfEnumToListOfEnumsAsStrings()} initialized to the given value.
*
* Sets the value of the MapOfEnumToListOfEnums property for this object.
*
* @param mapOfEnumToListOfEnums
* The new value for the MapOfEnumToListOfEnums property for this object.
*/
public static AllTypesUnionStructure fromMapOfEnumToListOfEnumsWithStrings(
Map<String, List<String>> mapOfEnumToListOfEnumsWithStrings) {
return builder().mapOfEnumToListOfEnumsWithStrings(mapOfEnumToListOfEnumsWithStrings).build();
}
/**
* Create an instance of this class with {@link #mapOfEnumToListOfEnumsAsStrings()} initialized to the given value.
*
* Sets the value of the MapOfEnumToListOfEnums property for this object.
*
* @param mapOfEnumToListOfEnums
* The new value for the MapOfEnumToListOfEnums property for this object.
*/
public static AllTypesUnionStructure fromMapOfEnumToListOfEnums(
Map<EnumType, List<EnumType>> mapOfEnumToListOfEnumsWithStrings) {
return builder().mapOfEnumToListOfEnums(mapOfEnumToListOfEnumsWithStrings).build();
}
/**
* Create an instance of this class with {@link #mapOfEnumToMapOfStringToEnumAsStrings()} initialized to the given
* value.
*
* Sets the value of the MapOfEnumToMapOfStringToEnum property for this object.
*
* @param mapOfEnumToMapOfStringToEnum
* The new value for the MapOfEnumToMapOfStringToEnum property for this object.
*/
public static AllTypesUnionStructure fromMapOfEnumToMapOfStringToEnumWithStrings(
Map<String, Map<String, String>> mapOfEnumToMapOfStringToEnumWithStrings) {
return builder().mapOfEnumToMapOfStringToEnumWithStrings(mapOfEnumToMapOfStringToEnumWithStrings).build();
}
/**
* Create an instance of this class with {@link #mapOfEnumToMapOfStringToEnumAsStrings()} initialized to the given
* value.
*
* Sets the value of the MapOfEnumToMapOfStringToEnum property for this object.
*
* @param mapOfEnumToMapOfStringToEnum
* The new value for the MapOfEnumToMapOfStringToEnum property for this object.
*/
public static AllTypesUnionStructure fromMapOfEnumToMapOfStringToEnum(
Map<EnumType, Map<String, EnumType>> mapOfEnumToMapOfStringToEnumWithStrings) {
return builder().mapOfEnumToMapOfStringToEnum(mapOfEnumToMapOfStringToEnumWithStrings).build();
}
/**
* Create an instance of this class with {@link #timestampMember()} initialized to the given value.
*
* Sets the value of the TimestampMember property for this object.
*
* @param timestampMember
* The new value for the TimestampMember property for this object.
*/
public static AllTypesUnionStructure fromTimestampMember(Instant timestampMember) {
return builder().timestampMember(timestampMember).build();
}
/**
* Create an instance of this class with {@link #structWithNestedTimestampMember()} initialized to the given value.
*
* Sets the value of the StructWithNestedTimestampMember property for this object.
*
* @param structWithNestedTimestampMember
* The new value for the StructWithNestedTimestampMember property for this object.
*/
public static AllTypesUnionStructure fromStructWithNestedTimestampMember(StructWithTimestamp structWithNestedTimestampMember) {
return builder().structWithNestedTimestampMember(structWithNestedTimestampMember).build();
}
/**
* Create an instance of this class with {@link #structWithNestedTimestampMember()} initialized to the given value.
*
* Sets the value of the StructWithNestedTimestampMember property for this object.
*
* @param structWithNestedTimestampMember
* The new value for the StructWithNestedTimestampMember property for this object.
*/
public static AllTypesUnionStructure fromStructWithNestedTimestampMember(
Consumer<StructWithTimestamp.Builder> structWithNestedTimestampMember) {
StructWithTimestamp.Builder builder = StructWithTimestamp.builder();
structWithNestedTimestampMember.accept(builder);
return fromStructWithNestedTimestampMember(builder.build());
}
/**
* Create an instance of this class with {@link #blobArg()} initialized to the given value.
*
* Sets the value of the BlobArg property for this object.
*
* @param blobArg
* The new value for the BlobArg property for this object.
*/
public static AllTypesUnionStructure fromBlobArg(SdkBytes blobArg) {
return builder().blobArg(blobArg).build();
}
/**
* Create an instance of this class with {@link #structWithNestedBlob()} initialized to the given value.
*
* Sets the value of the StructWithNestedBlob property for this object.
*
* @param structWithNestedBlob
* The new value for the StructWithNestedBlob property for this object.
*/
public static AllTypesUnionStructure fromStructWithNestedBlob(StructWithNestedBlobType structWithNestedBlob) {
return builder().structWithNestedBlob(structWithNestedBlob).build();
}
/**
* Create an instance of this class with {@link #structWithNestedBlob()} initialized to the given value.
*
* Sets the value of the StructWithNestedBlob property for this object.
*
* @param structWithNestedBlob
* The new value for the StructWithNestedBlob property for this object.
*/
public static AllTypesUnionStructure fromStructWithNestedBlob(Consumer<StructWithNestedBlobType.Builder> structWithNestedBlob) {
StructWithNestedBlobType.Builder builder = StructWithNestedBlobType.builder();
structWithNestedBlob.accept(builder);
return fromStructWithNestedBlob(builder.build());
}
/**
* Create an instance of this class with {@link #blobMap()} initialized to the given value.
*
* Sets the value of the BlobMap property for this object.
*
* @param blobMap
* The new value for the BlobMap property for this object.
*/
public static AllTypesUnionStructure fromBlobMap(Map<String, SdkBytes> blobMap) {
return builder().blobMap(blobMap).build();
}
/**
* Create an instance of this class with {@link #listOfBlobs()} initialized to the given value.
*
* Sets the value of the ListOfBlobs property for this object.
*
* @param listOfBlobs
* The new value for the ListOfBlobs property for this object.
*/
public static AllTypesUnionStructure fromListOfBlobs(List<SdkBytes> listOfBlobs) {
return builder().listOfBlobs(listOfBlobs).build();
}
/**
* Create an instance of this class with {@link #recursiveStruct()} initialized to the given value.
*
* Sets the value of the RecursiveStruct property for this object.
*
* @param recursiveStruct
* The new value for the RecursiveStruct property for this object.
*/
public static AllTypesUnionStructure fromRecursiveStruct(RecursiveStructType recursiveStruct) {
return builder().recursiveStruct(recursiveStruct).build();
}
/**
* Create an instance of this class with {@link #recursiveStruct()} initialized to the given value.
*
* Sets the value of the RecursiveStruct property for this object.
*
* @param recursiveStruct
* The new value for the RecursiveStruct property for this object.
*/
public static AllTypesUnionStructure fromRecursiveStruct(Consumer<RecursiveStructType.Builder> recursiveStruct) {
RecursiveStructType.Builder builder = RecursiveStructType.builder();
recursiveStruct.accept(builder);
return fromRecursiveStruct(builder.build());
}
/**
* Create an instance of this class with {@link #polymorphicTypeWithSubTypes()} initialized to the given value.
*
* Sets the value of the PolymorphicTypeWithSubTypes property for this object.
*
* @param polymorphicTypeWithSubTypes
* The new value for the PolymorphicTypeWithSubTypes property for this object.
*/
public static AllTypesUnionStructure fromPolymorphicTypeWithSubTypes(BaseType polymorphicTypeWithSubTypes) {
return builder().polymorphicTypeWithSubTypes(polymorphicTypeWithSubTypes).build();
}
/**
* Create an instance of this class with {@link #polymorphicTypeWithSubTypes()} initialized to the given value.
*
* Sets the value of the PolymorphicTypeWithSubTypes property for this object.
*
* @param polymorphicTypeWithSubTypes
* The new value for the PolymorphicTypeWithSubTypes property for this object.
*/
public static AllTypesUnionStructure fromPolymorphicTypeWithSubTypes(Consumer<BaseType.Builder> polymorphicTypeWithSubTypes) {
BaseType.Builder builder = BaseType.builder();
polymorphicTypeWithSubTypes.accept(builder);
return fromPolymorphicTypeWithSubTypes(builder.build());
}
/**
* Create an instance of this class with {@link #polymorphicTypeWithoutSubTypes()} initialized to the given value.
*
* Sets the value of the PolymorphicTypeWithoutSubTypes property for this object.
*
* @param polymorphicTypeWithoutSubTypes
* The new value for the PolymorphicTypeWithoutSubTypes property for this object.
*/
public static AllTypesUnionStructure fromPolymorphicTypeWithoutSubTypes(SubTypeOne polymorphicTypeWithoutSubTypes) {
return builder().polymorphicTypeWithoutSubTypes(polymorphicTypeWithoutSubTypes).build();
}
/**
* Create an instance of this class with {@link #polymorphicTypeWithoutSubTypes()} initialized to the given value.
*
* Sets the value of the PolymorphicTypeWithoutSubTypes property for this object.
*
* @param polymorphicTypeWithoutSubTypes
* The new value for the PolymorphicTypeWithoutSubTypes property for this object.
*/
public static AllTypesUnionStructure fromPolymorphicTypeWithoutSubTypes(
Consumer<SubTypeOne.Builder> polymorphicTypeWithoutSubTypes) {
SubTypeOne.Builder builder = SubTypeOne.builder();
polymorphicTypeWithoutSubTypes.accept(builder);
return fromPolymorphicTypeWithoutSubTypes(builder.build());
}
/**
* Create an instance of this class with {@link #enumTypeAsString()} initialized to the given value.
*
* Sets the value of the EnumType property for this object.
*
* @param enumType
* The new value for the EnumType property for this object.
* @see EnumType
*/
public static AllTypesUnionStructure fromEnumType(String enumType) {
return builder().enumType(enumType).build();
}
/**
* Create an instance of this class with {@link #enumTypeAsString()} initialized to the given value.
*
* Sets the value of the EnumType property for this object.
*
* @param enumType
* The new value for the EnumType property for this object.
* @see EnumType
*/
public static AllTypesUnionStructure fromEnumType(EnumType enumType) {
return builder().enumType(enumType).build();
}
/**
* Create an instance of this class with {@link #underscore_Name_Type()} initialized to the given value.
*
* Sets the value of the Underscore_Name_Type property for this object.
*
* @param underscore_Name_Type
* The new value for the Underscore_Name_Type property for this object.
*/
public static AllTypesUnionStructure fromUnderscore_Name_Type(Underscore_Name_Type underscore_Name_Type) {
return builder().underscore_Name_Type(underscore_Name_Type).build();
}
/**
* Create an instance of this class with {@link #underscore_Name_Type()} initialized to the given value.
*
* Sets the value of the Underscore_Name_Type property for this object.
*
* @param underscore_Name_Type
* The new value for the Underscore_Name_Type property for this object.
*/
public static AllTypesUnionStructure fromUnderscore_Name_Type(Consumer<Underscore_Name_Type.Builder> underscore_Name_Type) {
Underscore_Name_Type.Builder builder = Underscore_Name_Type.builder();
underscore_Name_Type.accept(builder);
return fromUnderscore_Name_Type(builder.build());
}
/**
* Create an instance of this class with {@link #myDocument()} initialized to the given value.
*
* Sets the value of the MyDocument property for this object.
*
* @param myDocument
* The new value for the MyDocument property for this object.
*/
public static AllTypesUnionStructure fromMyDocument(Document myDocument) {
return builder().myDocument(myDocument).build();
}
/**
* Create an instance of this class with {@link #allTypesUnionStructure()} initialized to the given value.
*
* Sets the value of the AllTypesUnionStructure property for this object.
*
* @param allTypesUnionStructure
* The new value for the AllTypesUnionStructure property for this object.
*/
public static AllTypesUnionStructure fromAllTypesUnionStructure(AllTypesUnionStructure allTypesUnionStructure) {
return builder().allTypesUnionStructure(allTypesUnionStructure).build();
}
/**
* Create an instance of this class with {@link #allTypesUnionStructure()} initialized to the given value.
*
* Sets the value of the AllTypesUnionStructure property for this object.
*
* @param allTypesUnionStructure
* The new value for the AllTypesUnionStructure property for this object.
*/
public static AllTypesUnionStructure fromAllTypesUnionStructure(Consumer<Builder> allTypesUnionStructure) {
Builder builder = AllTypesUnionStructure.builder();
allTypesUnionStructure.accept(builder);
return fromAllTypesUnionStructure(builder.build());
}
/**
* Retrieve an enum value representing which member of this object is populated.
*
* When this class is returned in a service response, this will be {@link Type#UNKNOWN_TO_SDK_VERSION} if the
* service returned a member that is only known to a newer SDK version.
*
* When this class is created directly in your code, this will be {@link Type#UNKNOWN_TO_SDK_VERSION} if zero
* members are set, and {@code null} if more than one member is set.
*/
public Type type() {
return type;
}
@Override
public final List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
private static <T> Function<Object, T> getter(Function<AllTypesUnionStructure, T> g) {
return obj -> g.apply((AllTypesUnionStructure) obj);
}
private static <T> BiConsumer<Object, T> setter(BiConsumer<Builder, T> s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
public interface Builder extends SdkPojo, CopyableBuilder<Builder, AllTypesUnionStructure> {
/**
* Sets the value of the StringMember property for this object.
*
* @param stringMember
* The new value for the StringMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder stringMember(String stringMember);
/**
* Sets the value of the IntegerMember property for this object.
*
* @param integerMember
* The new value for the IntegerMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder integerMember(Integer integerMember);
/**
* Sets the value of the BooleanMember property for this object.
*
* @param booleanMember
* The new value for the BooleanMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder booleanMember(Boolean booleanMember);
/**
* Sets the value of the FloatMember property for this object.
*
* @param floatMember
* The new value for the FloatMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder floatMember(Float floatMember);
/**
* Sets the value of the DoubleMember property for this object.
*
* @param doubleMember
* The new value for the DoubleMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder doubleMember(Double doubleMember);
/**
* Sets the value of the LongMember property for this object.
*
* @param longMember
* The new value for the LongMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder longMember(Long longMember);
/**
* Sets the value of the ShortMember property for this object.
*
* @param shortMember
* The new value for the ShortMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder shortMember(Short shortMember);
/**
* Sets the value of the SimpleList property for this object.
*
* @param simpleList
* The new value for the SimpleList property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder simpleList(Collection<String> simpleList);
/**
* Sets the value of the SimpleList property for this object.
*
* @param simpleList
* The new value for the SimpleList property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder simpleList(String... simpleList);
/**
* Sets the value of the ListOfEnums property for this object.
*
* @param listOfEnums
* The new value for the ListOfEnums property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfEnumsWithStrings(Collection<String> listOfEnums);
/**
* Sets the value of the ListOfEnums property for this object.
*
* @param listOfEnums
* The new value for the ListOfEnums property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfEnumsWithStrings(String... listOfEnums);
/**
* Sets the value of the ListOfEnums property for this object.
*
* @param listOfEnums
* The new value for the ListOfEnums property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfEnums(Collection<EnumType> listOfEnums);
/**
* Sets the value of the ListOfEnums property for this object.
*
* @param listOfEnums
* The new value for the ListOfEnums property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfEnums(EnumType... listOfEnums);
/**
* Sets the value of the ListOfMaps property for this object.
*
* @param listOfMaps
* The new value for the ListOfMaps property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfMaps(Collection<? extends Map<String, String>> listOfMaps);
/**
* Sets the value of the ListOfMaps property for this object.
*
* @param listOfMaps
* The new value for the ListOfMaps property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfMaps(Map<String, String>... listOfMaps);
/**
* Sets the value of the ListOfStructs property for this object.
*
* @param listOfStructs
* The new value for the ListOfStructs property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfStructs(Collection<SimpleStruct> listOfStructs);
/**
* Sets the value of the ListOfStructs property for this object.
*
* @param listOfStructs
* The new value for the ListOfStructs property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfStructs(SimpleStruct... listOfStructs);
/**
* Sets the value of the ListOfStructs property for this object.
*
* This is a convenience method that creates an instance of the
* {@link software.amazon.awssdk.services.jsonprotocoltests.model.SimpleStruct.Builder} avoiding the need to
* create one manually via
* {@link software.amazon.awssdk.services.jsonprotocoltests.model.SimpleStruct#builder()}.
*
* <p>
* When the {@link Consumer} completes,
* {@link software.amazon.awssdk.services.jsonprotocoltests.model.SimpleStruct.Builder#build()} is called
* immediately and its result is passed to {@link #listOfStructs(List<SimpleStruct>)}.
*
* @param listOfStructs
* a consumer that will call methods on
* {@link software.amazon.awssdk.services.jsonprotocoltests.model.SimpleStruct.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #listOfStructs(java.util.Collection<SimpleStruct>)
*/
Builder listOfStructs(Consumer<SimpleStruct.Builder>... listOfStructs);
/**
* Sets the value of the ListOfMapOfEnumToString property for this object.
*
* @param listOfMapOfEnumToString
* The new value for the ListOfMapOfEnumToString property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfMapOfEnumToStringWithStrings(Collection<? extends Map<String, String>> listOfMapOfEnumToString);
/**
* Sets the value of the ListOfMapOfEnumToString property for this object.
*
* @param listOfMapOfEnumToString
* The new value for the ListOfMapOfEnumToString property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfMapOfEnumToStringWithStrings(Map<String, String>... listOfMapOfEnumToString);
/**
* Sets the value of the ListOfMapOfStringToStruct property for this object.
*
* @param listOfMapOfStringToStruct
* The new value for the ListOfMapOfStringToStruct property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfMapOfStringToStruct(Collection<? extends Map<String, SimpleStruct>> listOfMapOfStringToStruct);
/**
* Sets the value of the ListOfMapOfStringToStruct property for this object.
*
* @param listOfMapOfStringToStruct
* The new value for the ListOfMapOfStringToStruct property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfMapOfStringToStruct(Map<String, SimpleStruct>... listOfMapOfStringToStruct);
/**
* Sets the value of the MapOfStringToIntegerList property for this object.
*
* @param mapOfStringToIntegerList
* The new value for the MapOfStringToIntegerList property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfStringToIntegerList(Map<String, ? extends Collection<Integer>> mapOfStringToIntegerList);
/**
* Sets the value of the MapOfStringToString property for this object.
*
* @param mapOfStringToString
* The new value for the MapOfStringToString property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfStringToString(Map<String, String> mapOfStringToString);
/**
* Sets the value of the MapOfStringToSimpleStruct property for this object.
*
* @param mapOfStringToSimpleStruct
* The new value for the MapOfStringToSimpleStruct property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfStringToSimpleStruct(Map<String, SimpleStruct> mapOfStringToSimpleStruct);
/**
* Sets the value of the MapOfEnumToEnum property for this object.
*
* @param mapOfEnumToEnum
* The new value for the MapOfEnumToEnum property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfEnumToEnumWithStrings(Map<String, String> mapOfEnumToEnum);
/**
* Sets the value of the MapOfEnumToEnum property for this object.
*
* @param mapOfEnumToEnum
* The new value for the MapOfEnumToEnum property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfEnumToEnum(Map<EnumType, EnumType> mapOfEnumToEnum);
/**
* Sets the value of the MapOfEnumToString property for this object.
*
* @param mapOfEnumToString
* The new value for the MapOfEnumToString property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfEnumToStringWithStrings(Map<String, String> mapOfEnumToString);
/**
* Sets the value of the MapOfEnumToString property for this object.
*
* @param mapOfEnumToString
* The new value for the MapOfEnumToString property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfEnumToString(Map<EnumType, String> mapOfEnumToString);
/**
* Sets the value of the MapOfStringToEnum property for this object.
*
* @param mapOfStringToEnum
* The new value for the MapOfStringToEnum property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfStringToEnumWithStrings(Map<String, String> mapOfStringToEnum);
/**
* Sets the value of the MapOfStringToEnum property for this object.
*
* @param mapOfStringToEnum
* The new value for the MapOfStringToEnum property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfStringToEnum(Map<String, EnumType> mapOfStringToEnum);
/**
* Sets the value of the MapOfEnumToSimpleStruct property for this object.
*
* @param mapOfEnumToSimpleStruct
* The new value for the MapOfEnumToSimpleStruct property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfEnumToSimpleStructWithStrings(Map<String, SimpleStruct> mapOfEnumToSimpleStruct);
/**
* Sets the value of the MapOfEnumToSimpleStruct property for this object.
*
* @param mapOfEnumToSimpleStruct
* The new value for the MapOfEnumToSimpleStruct property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfEnumToSimpleStruct(Map<EnumType, SimpleStruct> mapOfEnumToSimpleStruct);
/**
* Sets the value of the MapOfEnumToListOfEnums property for this object.
*
* @param mapOfEnumToListOfEnums
* The new value for the MapOfEnumToListOfEnums property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfEnumToListOfEnumsWithStrings(Map<String, ? extends Collection<String>> mapOfEnumToListOfEnums);
/**
* Sets the value of the MapOfEnumToListOfEnums property for this object.
*
* @param mapOfEnumToListOfEnums
* The new value for the MapOfEnumToListOfEnums property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfEnumToListOfEnums(Map<EnumType, ? extends Collection<EnumType>> mapOfEnumToListOfEnums);
/**
* Sets the value of the MapOfEnumToMapOfStringToEnum property for this object.
*
* @param mapOfEnumToMapOfStringToEnum
* The new value for the MapOfEnumToMapOfStringToEnum property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfEnumToMapOfStringToEnumWithStrings(Map<String, ? extends Map<String, String>> mapOfEnumToMapOfStringToEnum);
/**
* Sets the value of the MapOfEnumToMapOfStringToEnum property for this object.
*
* @param mapOfEnumToMapOfStringToEnum
* The new value for the MapOfEnumToMapOfStringToEnum property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfEnumToMapOfStringToEnum(Map<EnumType, ? extends Map<String, EnumType>> mapOfEnumToMapOfStringToEnum);
/**
* Sets the value of the TimestampMember property for this object.
*
* @param timestampMember
* The new value for the TimestampMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder timestampMember(Instant timestampMember);
/**
* Sets the value of the StructWithNestedTimestampMember property for this object.
*
* @param structWithNestedTimestampMember
* The new value for the StructWithNestedTimestampMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder structWithNestedTimestampMember(StructWithTimestamp structWithNestedTimestampMember);
/**
* Sets the value of the StructWithNestedTimestampMember property for this object.
*
* This is a convenience method that creates an instance of the {@link StructWithTimestamp.Builder} avoiding the
* need to create one manually via {@link StructWithTimestamp#builder()}.
*
* <p>
* When the {@link Consumer} completes, {@link StructWithTimestamp.Builder#build()} is called immediately and
* its result is passed to {@link #structWithNestedTimestampMember(StructWithTimestamp)}.
*
* @param structWithNestedTimestampMember
* a consumer that will call methods on {@link StructWithTimestamp.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #structWithNestedTimestampMember(StructWithTimestamp)
*/
default Builder structWithNestedTimestampMember(Consumer<StructWithTimestamp.Builder> structWithNestedTimestampMember) {
return structWithNestedTimestampMember(StructWithTimestamp.builder().applyMutation(structWithNestedTimestampMember)
.build());
}
/**
* Sets the value of the BlobArg property for this object.
*
* @param blobArg
* The new value for the BlobArg property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder blobArg(SdkBytes blobArg);
/**
* Sets the value of the StructWithNestedBlob property for this object.
*
* @param structWithNestedBlob
* The new value for the StructWithNestedBlob property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder structWithNestedBlob(StructWithNestedBlobType structWithNestedBlob);
/**
* Sets the value of the StructWithNestedBlob property for this object.
*
* This is a convenience method that creates an instance of the {@link StructWithNestedBlobType.Builder}
* avoiding the need to create one manually via {@link StructWithNestedBlobType#builder()}.
*
* <p>
* When the {@link Consumer} completes, {@link StructWithNestedBlobType.Builder#build()} is called immediately
* and its result is passed to {@link #structWithNestedBlob(StructWithNestedBlobType)}.
*
* @param structWithNestedBlob
* a consumer that will call methods on {@link StructWithNestedBlobType.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #structWithNestedBlob(StructWithNestedBlobType)
*/
default Builder structWithNestedBlob(Consumer<StructWithNestedBlobType.Builder> structWithNestedBlob) {
return structWithNestedBlob(StructWithNestedBlobType.builder().applyMutation(structWithNestedBlob).build());
}
/**
* Sets the value of the BlobMap property for this object.
*
* @param blobMap
* The new value for the BlobMap property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder blobMap(Map<String, SdkBytes> blobMap);
/**
* Sets the value of the ListOfBlobs property for this object.
*
* @param listOfBlobs
* The new value for the ListOfBlobs property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfBlobs(Collection<SdkBytes> listOfBlobs);
/**
* Sets the value of the ListOfBlobs property for this object.
*
* @param listOfBlobs
* The new value for the ListOfBlobs property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfBlobs(SdkBytes... listOfBlobs);
/**
* Sets the value of the RecursiveStruct property for this object.
*
* @param recursiveStruct
* The new value for the RecursiveStruct property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder recursiveStruct(RecursiveStructType recursiveStruct);
/**
* Sets the value of the RecursiveStruct property for this object.
*
* This is a convenience method that creates an instance of the {@link RecursiveStructType.Builder} avoiding the
* need to create one manually via {@link RecursiveStructType#builder()}.
*
* <p>
* When the {@link Consumer} completes, {@link RecursiveStructType.Builder#build()} is called immediately and
* its result is passed to {@link #recursiveStruct(RecursiveStructType)}.
*
* @param recursiveStruct
* a consumer that will call methods on {@link RecursiveStructType.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #recursiveStruct(RecursiveStructType)
*/
default Builder recursiveStruct(Consumer<RecursiveStructType.Builder> recursiveStruct) {
return recursiveStruct(RecursiveStructType.builder().applyMutation(recursiveStruct).build());
}
/**
* Sets the value of the PolymorphicTypeWithSubTypes property for this object.
*
* @param polymorphicTypeWithSubTypes
* The new value for the PolymorphicTypeWithSubTypes property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder polymorphicTypeWithSubTypes(BaseType polymorphicTypeWithSubTypes);
/**
* Sets the value of the PolymorphicTypeWithSubTypes property for this object.
*
* This is a convenience method that creates an instance of the {@link BaseType.Builder} avoiding the need to
* create one manually via {@link BaseType#builder()}.
*
* <p>
* When the {@link Consumer} completes, {@link BaseType.Builder#build()} is called immediately and its result is
* passed to {@link #polymorphicTypeWithSubTypes(BaseType)}.
*
* @param polymorphicTypeWithSubTypes
* a consumer that will call methods on {@link BaseType.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #polymorphicTypeWithSubTypes(BaseType)
*/
default Builder polymorphicTypeWithSubTypes(Consumer<BaseType.Builder> polymorphicTypeWithSubTypes) {
return polymorphicTypeWithSubTypes(BaseType.builder().applyMutation(polymorphicTypeWithSubTypes).build());
}
/**
* Sets the value of the PolymorphicTypeWithoutSubTypes property for this object.
*
* @param polymorphicTypeWithoutSubTypes
* The new value for the PolymorphicTypeWithoutSubTypes property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder polymorphicTypeWithoutSubTypes(SubTypeOne polymorphicTypeWithoutSubTypes);
/**
* Sets the value of the PolymorphicTypeWithoutSubTypes property for this object.
*
* This is a convenience method that creates an instance of the {@link SubTypeOne.Builder} avoiding the need to
* create one manually via {@link SubTypeOne#builder()}.
*
* <p>
* When the {@link Consumer} completes, {@link SubTypeOne.Builder#build()} is called immediately and its result
* is passed to {@link #polymorphicTypeWithoutSubTypes(SubTypeOne)}.
*
* @param polymorphicTypeWithoutSubTypes
* a consumer that will call methods on {@link SubTypeOne.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #polymorphicTypeWithoutSubTypes(SubTypeOne)
*/
default Builder polymorphicTypeWithoutSubTypes(Consumer<SubTypeOne.Builder> polymorphicTypeWithoutSubTypes) {
return polymorphicTypeWithoutSubTypes(SubTypeOne.builder().applyMutation(polymorphicTypeWithoutSubTypes).build());
}
/**
* Sets the value of the EnumType property for this object.
*
* @param enumType
* The new value for the EnumType property for this object.
* @see EnumType
* @return Returns a reference to this object so that method calls can be chained together.
* @see EnumType
*/
Builder enumType(String enumType);
/**
* Sets the value of the EnumType property for this object.
*
* @param enumType
* The new value for the EnumType property for this object.
* @see EnumType
* @return Returns a reference to this object so that method calls can be chained together.
* @see EnumType
*/
Builder enumType(EnumType enumType);
/**
* Sets the value of the Underscore_Name_Type property for this object.
*
* @param underscore_Name_Type
* The new value for the Underscore_Name_Type property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder underscore_Name_Type(Underscore_Name_Type underscore_Name_Type);
/**
* Sets the value of the Underscore_Name_Type property for this object.
*
* This is a convenience method that creates an instance of the {@link Underscore_Name_Type.Builder} avoiding
* the need to create one manually via {@link Underscore_Name_Type#builder()}.
*
* <p>
* When the {@link Consumer} completes, {@link Underscore_Name_Type.Builder#build()} is called immediately and
* its result is passed to {@link #underscore_Name_Type(Underscore_Name_Type)}.
*
* @param underscore_Name_Type
* a consumer that will call methods on {@link Underscore_Name_Type.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #underscore_Name_Type(Underscore_Name_Type)
*/
default Builder underscore_Name_Type(Consumer<Underscore_Name_Type.Builder> underscore_Name_Type) {
return underscore_Name_Type(Underscore_Name_Type.builder().applyMutation(underscore_Name_Type).build());
}
/**
* Sets the value of the MyDocument property for this object.
*
* @param myDocument
* The new value for the MyDocument property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder myDocument(Document myDocument);
/**
* Sets the value of the AllTypesUnionStructure property for this object.
*
* @param allTypesUnionStructure
* The new value for the AllTypesUnionStructure property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder allTypesUnionStructure(AllTypesUnionStructure allTypesUnionStructure);
/**
* Sets the value of the AllTypesUnionStructure property for this object.
*
* This is a convenience method that creates an instance of the {@link AllTypesUnionStructure.Builder} avoiding
* the need to create one manually via {@link AllTypesUnionStructure#builder()}.
*
* <p>
* When the {@link Consumer} completes, {@link AllTypesUnionStructure.Builder#build()} is called immediately and
* its result is passed to {@link #allTypesUnionStructure(AllTypesUnionStructure)}.
*
* @param allTypesUnionStructure
* a consumer that will call methods on {@link AllTypesUnionStructure.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #allTypesUnionStructure(AllTypesUnionStructure)
*/
default Builder allTypesUnionStructure(Consumer<Builder> allTypesUnionStructure) {
return allTypesUnionStructure(AllTypesUnionStructure.builder().applyMutation(allTypesUnionStructure).build());
}
}
static final class BuilderImpl implements Builder {
private String stringMember;
private Integer integerMember;
private Boolean booleanMember;
private Float floatMember;
private Double doubleMember;
private Long longMember;
private Short shortMember;
private List<String> simpleList = DefaultSdkAutoConstructList.getInstance();
private List<String> listOfEnums = DefaultSdkAutoConstructList.getInstance();
private List<Map<String, String>> listOfMaps = DefaultSdkAutoConstructList.getInstance();
private List<SimpleStruct> listOfStructs = DefaultSdkAutoConstructList.getInstance();
private List<Map<String, String>> listOfMapOfEnumToString = DefaultSdkAutoConstructList.getInstance();
private List<Map<String, SimpleStruct>> listOfMapOfStringToStruct = DefaultSdkAutoConstructList.getInstance();
private Map<String, List<Integer>> mapOfStringToIntegerList = DefaultSdkAutoConstructMap.getInstance();
private Map<String, String> mapOfStringToString = DefaultSdkAutoConstructMap.getInstance();
private Map<String, SimpleStruct> mapOfStringToSimpleStruct = DefaultSdkAutoConstructMap.getInstance();
private Map<String, String> mapOfEnumToEnum = DefaultSdkAutoConstructMap.getInstance();
private Map<String, String> mapOfEnumToString = DefaultSdkAutoConstructMap.getInstance();
private Map<String, String> mapOfStringToEnum = DefaultSdkAutoConstructMap.getInstance();
private Map<String, SimpleStruct> mapOfEnumToSimpleStruct = DefaultSdkAutoConstructMap.getInstance();
private Map<String, List<String>> mapOfEnumToListOfEnums = DefaultSdkAutoConstructMap.getInstance();
private Map<String, Map<String, String>> mapOfEnumToMapOfStringToEnum = DefaultSdkAutoConstructMap.getInstance();
private Instant timestampMember;
private StructWithTimestamp structWithNestedTimestampMember;
private SdkBytes blobArg;
private StructWithNestedBlobType structWithNestedBlob;
private Map<String, SdkBytes> blobMap = DefaultSdkAutoConstructMap.getInstance();
private List<SdkBytes> listOfBlobs = DefaultSdkAutoConstructList.getInstance();
private RecursiveStructType recursiveStruct;
private BaseType polymorphicTypeWithSubTypes;
private SubTypeOne polymorphicTypeWithoutSubTypes;
private String enumType;
private Underscore_Name_Type underscore_Name_Type;
private Document myDocument;
private AllTypesUnionStructure allTypesUnionStructure;
private Type type = Type.UNKNOWN_TO_SDK_VERSION;
private Set<Type> setTypes = EnumSet.noneOf(Type.class);
private BuilderImpl() {
}
private BuilderImpl(AllTypesUnionStructure model) {
stringMember(model.stringMember);
integerMember(model.integerMember);
booleanMember(model.booleanMember);
floatMember(model.floatMember);
doubleMember(model.doubleMember);
longMember(model.longMember);
shortMember(model.shortMember);
simpleList(model.simpleList);
listOfEnumsWithStrings(model.listOfEnums);
listOfMaps(model.listOfMaps);
listOfStructs(model.listOfStructs);
listOfMapOfEnumToStringWithStrings(model.listOfMapOfEnumToString);
listOfMapOfStringToStruct(model.listOfMapOfStringToStruct);
mapOfStringToIntegerList(model.mapOfStringToIntegerList);
mapOfStringToString(model.mapOfStringToString);
mapOfStringToSimpleStruct(model.mapOfStringToSimpleStruct);
mapOfEnumToEnumWithStrings(model.mapOfEnumToEnum);
mapOfEnumToStringWithStrings(model.mapOfEnumToString);
mapOfStringToEnumWithStrings(model.mapOfStringToEnum);
mapOfEnumToSimpleStructWithStrings(model.mapOfEnumToSimpleStruct);
mapOfEnumToListOfEnumsWithStrings(model.mapOfEnumToListOfEnums);
mapOfEnumToMapOfStringToEnumWithStrings(model.mapOfEnumToMapOfStringToEnum);
timestampMember(model.timestampMember);
structWithNestedTimestampMember(model.structWithNestedTimestampMember);
blobArg(model.blobArg);
structWithNestedBlob(model.structWithNestedBlob);
blobMap(model.blobMap);
listOfBlobs(model.listOfBlobs);
recursiveStruct(model.recursiveStruct);
polymorphicTypeWithSubTypes(model.polymorphicTypeWithSubTypes);
polymorphicTypeWithoutSubTypes(model.polymorphicTypeWithoutSubTypes);
enumType(model.enumType);
underscore_Name_Type(model.underscore_Name_Type);
myDocument(model.myDocument);
allTypesUnionStructure(model.allTypesUnionStructure);
}
public final String getStringMember() {
return stringMember;
}
public final void setStringMember(String stringMember) {
Object oldValue = this.stringMember;
this.stringMember = stringMember;
handleUnionValueChange(Type.STRING_MEMBER, oldValue, this.stringMember);
}
@Override
public final Builder stringMember(String stringMember) {
Object oldValue = this.stringMember;
this.stringMember = stringMember;
handleUnionValueChange(Type.STRING_MEMBER, oldValue, this.stringMember);
return this;
}
public final Integer getIntegerMember() {
return integerMember;
}
public final void setIntegerMember(Integer integerMember) {
Object oldValue = this.integerMember;
this.integerMember = integerMember;
handleUnionValueChange(Type.INTEGER_MEMBER, oldValue, this.integerMember);
}
@Override
public final Builder integerMember(Integer integerMember) {
Object oldValue = this.integerMember;
this.integerMember = integerMember;
handleUnionValueChange(Type.INTEGER_MEMBER, oldValue, this.integerMember);
return this;
}
public final Boolean getBooleanMember() {
return booleanMember;
}
public final void setBooleanMember(Boolean booleanMember) {
Object oldValue = this.booleanMember;
this.booleanMember = booleanMember;
handleUnionValueChange(Type.BOOLEAN_MEMBER, oldValue, this.booleanMember);
}
@Override
public final Builder booleanMember(Boolean booleanMember) {
Object oldValue = this.booleanMember;
this.booleanMember = booleanMember;
handleUnionValueChange(Type.BOOLEAN_MEMBER, oldValue, this.booleanMember);
return this;
}
public final Float getFloatMember() {
return floatMember;
}
public final void setFloatMember(Float floatMember) {
Object oldValue = this.floatMember;
this.floatMember = floatMember;
handleUnionValueChange(Type.FLOAT_MEMBER, oldValue, this.floatMember);
}
@Override
public final Builder floatMember(Float floatMember) {
Object oldValue = this.floatMember;
this.floatMember = floatMember;
handleUnionValueChange(Type.FLOAT_MEMBER, oldValue, this.floatMember);
return this;
}
public final Double getDoubleMember() {
return doubleMember;
}
public final void setDoubleMember(Double doubleMember) {
Object oldValue = this.doubleMember;
this.doubleMember = doubleMember;
handleUnionValueChange(Type.DOUBLE_MEMBER, oldValue, this.doubleMember);
}
@Override
public final Builder doubleMember(Double doubleMember) {
Object oldValue = this.doubleMember;
this.doubleMember = doubleMember;
handleUnionValueChange(Type.DOUBLE_MEMBER, oldValue, this.doubleMember);
return this;
}
public final Long getLongMember() {
return longMember;
}
public final void setLongMember(Long longMember) {
Object oldValue = this.longMember;
this.longMember = longMember;
handleUnionValueChange(Type.LONG_MEMBER, oldValue, this.longMember);
}
@Override
public final Builder longMember(Long longMember) {
Object oldValue = this.longMember;
this.longMember = longMember;
handleUnionValueChange(Type.LONG_MEMBER, oldValue, this.longMember);
return this;
}
public final Short getShortMember() {
return shortMember;
}
public final void setShortMember(Short shortMember) {
Object oldValue = this.shortMember;
this.shortMember = shortMember;
handleUnionValueChange(Type.SHORT_MEMBER, oldValue, this.shortMember);
}
@Override
public final Builder shortMember(Short shortMember) {
Object oldValue = this.shortMember;
this.shortMember = shortMember;
handleUnionValueChange(Type.SHORT_MEMBER, oldValue, this.shortMember);
return this;
}
public final Collection<String> getSimpleList() {
if (simpleList instanceof SdkAutoConstructList) {
return null;
}
return simpleList;
}
public final void setSimpleList(Collection<String> simpleList) {
Object oldValue = this.simpleList;
this.simpleList = ListOfStringsCopier.copy(simpleList);
handleUnionValueChange(Type.SIMPLE_LIST, oldValue, this.simpleList);
}
@Override
public final Builder simpleList(Collection<String> simpleList) {
Object oldValue = this.simpleList;
this.simpleList = ListOfStringsCopier.copy(simpleList);
handleUnionValueChange(Type.SIMPLE_LIST, oldValue, this.simpleList);
return this;
}
@Override
@SafeVarargs
public final Builder simpleList(String... simpleList) {
simpleList(Arrays.asList(simpleList));
return this;
}
public final Collection<String> getListOfEnums() {
if (listOfEnums instanceof SdkAutoConstructList) {
return null;
}
return listOfEnums;
}
public final void setListOfEnums(Collection<String> listOfEnums) {
Object oldValue = this.listOfEnums;
this.listOfEnums = ListOfEnumsCopier.copy(listOfEnums);
handleUnionValueChange(Type.LIST_OF_ENUMS, oldValue, this.listOfEnums);
}
@Override
public final Builder listOfEnumsWithStrings(Collection<String> listOfEnums) {
Object oldValue = this.listOfEnums;
this.listOfEnums = ListOfEnumsCopier.copy(listOfEnums);
handleUnionValueChange(Type.LIST_OF_ENUMS, oldValue, this.listOfEnums);
return this;
}
@Override
@SafeVarargs
public final Builder listOfEnumsWithStrings(String... listOfEnums) {
listOfEnumsWithStrings(Arrays.asList(listOfEnums));
return this;
}
@Override
public final Builder listOfEnums(Collection<EnumType> listOfEnums) {
Object oldValue = this.listOfEnums;
this.listOfEnums = ListOfEnumsCopier.copyEnumToString(listOfEnums);
handleUnionValueChange(Type.LIST_OF_ENUMS, oldValue, this.listOfEnums);
return this;
}
@Override
@SafeVarargs
public final Builder listOfEnums(EnumType... listOfEnums) {
listOfEnums(Arrays.asList(listOfEnums));
return this;
}
public final Collection<? extends Map<String, String>> getListOfMaps() {
if (listOfMaps instanceof SdkAutoConstructList) {
return null;
}
return listOfMaps;
}
public final void setListOfMaps(Collection<? extends Map<String, String>> listOfMaps) {
Object oldValue = this.listOfMaps;
this.listOfMaps = ListOfMapStringToStringCopier.copy(listOfMaps);
handleUnionValueChange(Type.LIST_OF_MAPS, oldValue, this.listOfMaps);
}
@Override
public final Builder listOfMaps(Collection<? extends Map<String, String>> listOfMaps) {
Object oldValue = this.listOfMaps;
this.listOfMaps = ListOfMapStringToStringCopier.copy(listOfMaps);
handleUnionValueChange(Type.LIST_OF_MAPS, oldValue, this.listOfMaps);
return this;
}
@Override
@SafeVarargs
public final Builder listOfMaps(Map<String, String>... listOfMaps) {
listOfMaps(Arrays.asList(listOfMaps));
return this;
}
public final List<SimpleStruct.Builder> getListOfStructs() {
List<SimpleStruct.Builder> result = ListOfSimpleStructsCopier.copyToBuilder(this.listOfStructs);
if (result instanceof SdkAutoConstructList) {
return null;
}
return result;
}
public final void setListOfStructs(Collection<SimpleStruct.BuilderImpl> listOfStructs) {
Object oldValue = this.listOfStructs;
this.listOfStructs = ListOfSimpleStructsCopier.copyFromBuilder(listOfStructs);
handleUnionValueChange(Type.LIST_OF_STRUCTS, oldValue, this.listOfStructs);
}
@Override
public final Builder listOfStructs(Collection<SimpleStruct> listOfStructs) {
Object oldValue = this.listOfStructs;
this.listOfStructs = ListOfSimpleStructsCopier.copy(listOfStructs);
handleUnionValueChange(Type.LIST_OF_STRUCTS, oldValue, this.listOfStructs);
return this;
}
@Override
@SafeVarargs
public final Builder listOfStructs(SimpleStruct... listOfStructs) {
listOfStructs(Arrays.asList(listOfStructs));
return this;
}
@Override
@SafeVarargs
public final Builder listOfStructs(Consumer<SimpleStruct.Builder>... listOfStructs) {
listOfStructs(Stream.of(listOfStructs).map(c -> SimpleStruct.builder().applyMutation(c).build())
.collect(Collectors.toList()));
return this;
}
public final Collection<? extends Map<String, String>> getListOfMapOfEnumToString() {
if (listOfMapOfEnumToString instanceof SdkAutoConstructList) {
return null;
}
return listOfMapOfEnumToString;
}
public final void setListOfMapOfEnumToString(Collection<? extends Map<String, String>> listOfMapOfEnumToString) {
Object oldValue = this.listOfMapOfEnumToString;
this.listOfMapOfEnumToString = ListOfMapOfEnumToStringCopier.copy(listOfMapOfEnumToString);
handleUnionValueChange(Type.LIST_OF_MAP_OF_ENUM_TO_STRING, oldValue, this.listOfMapOfEnumToString);
}
@Override
public final Builder listOfMapOfEnumToStringWithStrings(Collection<? extends Map<String, String>> listOfMapOfEnumToString) {
Object oldValue = this.listOfMapOfEnumToString;
this.listOfMapOfEnumToString = ListOfMapOfEnumToStringCopier.copy(listOfMapOfEnumToString);
handleUnionValueChange(Type.LIST_OF_MAP_OF_ENUM_TO_STRING, oldValue, this.listOfMapOfEnumToString);
return this;
}
@Override
@SafeVarargs
public final Builder listOfMapOfEnumToStringWithStrings(Map<String, String>... listOfMapOfEnumToString) {
listOfMapOfEnumToStringWithStrings(Arrays.asList(listOfMapOfEnumToString));
return this;
}
public final List<Map<String, SimpleStruct.Builder>> getListOfMapOfStringToStruct() {
List<Map<String, SimpleStruct.Builder>> result = ListOfMapOfStringToStructCopier
.copyToBuilder(this.listOfMapOfStringToStruct);
if (result instanceof SdkAutoConstructList) {
return null;
}
return result;
}
public final void setListOfMapOfStringToStruct(
Collection<? extends Map<String, SimpleStruct.BuilderImpl>> listOfMapOfStringToStruct) {
Object oldValue = this.listOfMapOfStringToStruct;
this.listOfMapOfStringToStruct = ListOfMapOfStringToStructCopier.copyFromBuilder(listOfMapOfStringToStruct);
handleUnionValueChange(Type.LIST_OF_MAP_OF_STRING_TO_STRUCT, oldValue, this.listOfMapOfStringToStruct);
}
@Override
public final Builder listOfMapOfStringToStruct(Collection<? extends Map<String, SimpleStruct>> listOfMapOfStringToStruct) {
Object oldValue = this.listOfMapOfStringToStruct;
this.listOfMapOfStringToStruct = ListOfMapOfStringToStructCopier.copy(listOfMapOfStringToStruct);
handleUnionValueChange(Type.LIST_OF_MAP_OF_STRING_TO_STRUCT, oldValue, this.listOfMapOfStringToStruct);
return this;
}
@Override
@SafeVarargs
public final Builder listOfMapOfStringToStruct(Map<String, SimpleStruct>... listOfMapOfStringToStruct) {
listOfMapOfStringToStruct(Arrays.asList(listOfMapOfStringToStruct));
return this;
}
public final Map<String, ? extends Collection<Integer>> getMapOfStringToIntegerList() {
if (mapOfStringToIntegerList instanceof SdkAutoConstructMap) {
return null;
}
return mapOfStringToIntegerList;
}
public final void setMapOfStringToIntegerList(Map<String, ? extends Collection<Integer>> mapOfStringToIntegerList) {
Object oldValue = this.mapOfStringToIntegerList;
this.mapOfStringToIntegerList = MapOfStringToIntegerListCopier.copy(mapOfStringToIntegerList);
handleUnionValueChange(Type.MAP_OF_STRING_TO_INTEGER_LIST, oldValue, this.mapOfStringToIntegerList);
}
@Override
public final Builder mapOfStringToIntegerList(Map<String, ? extends Collection<Integer>> mapOfStringToIntegerList) {
Object oldValue = this.mapOfStringToIntegerList;
this.mapOfStringToIntegerList = MapOfStringToIntegerListCopier.copy(mapOfStringToIntegerList);
handleUnionValueChange(Type.MAP_OF_STRING_TO_INTEGER_LIST, oldValue, this.mapOfStringToIntegerList);
return this;
}
public final Map<String, String> getMapOfStringToString() {
if (mapOfStringToString instanceof SdkAutoConstructMap) {
return null;
}
return mapOfStringToString;
}
public final void setMapOfStringToString(Map<String, String> mapOfStringToString) {
Object oldValue = this.mapOfStringToString;
this.mapOfStringToString = MapOfStringToStringCopier.copy(mapOfStringToString);
handleUnionValueChange(Type.MAP_OF_STRING_TO_STRING, oldValue, this.mapOfStringToString);
}
@Override
public final Builder mapOfStringToString(Map<String, String> mapOfStringToString) {
Object oldValue = this.mapOfStringToString;
this.mapOfStringToString = MapOfStringToStringCopier.copy(mapOfStringToString);
handleUnionValueChange(Type.MAP_OF_STRING_TO_STRING, oldValue, this.mapOfStringToString);
return this;
}
public final Map<String, SimpleStruct.Builder> getMapOfStringToSimpleStruct() {
Map<String, SimpleStruct.Builder> result = MapOfStringToSimpleStructCopier
.copyToBuilder(this.mapOfStringToSimpleStruct);
if (result instanceof SdkAutoConstructMap) {
return null;
}
return result;
}
public final void setMapOfStringToSimpleStruct(Map<String, SimpleStruct.BuilderImpl> mapOfStringToSimpleStruct) {
Object oldValue = this.mapOfStringToSimpleStruct;
this.mapOfStringToSimpleStruct = MapOfStringToSimpleStructCopier.copyFromBuilder(mapOfStringToSimpleStruct);
handleUnionValueChange(Type.MAP_OF_STRING_TO_SIMPLE_STRUCT, oldValue, this.mapOfStringToSimpleStruct);
}
@Override
public final Builder mapOfStringToSimpleStruct(Map<String, SimpleStruct> mapOfStringToSimpleStruct) {
Object oldValue = this.mapOfStringToSimpleStruct;
this.mapOfStringToSimpleStruct = MapOfStringToSimpleStructCopier.copy(mapOfStringToSimpleStruct);
handleUnionValueChange(Type.MAP_OF_STRING_TO_SIMPLE_STRUCT, oldValue, this.mapOfStringToSimpleStruct);
return this;
}
public final Map<String, String> getMapOfEnumToEnum() {
if (mapOfEnumToEnum instanceof SdkAutoConstructMap) {
return null;
}
return mapOfEnumToEnum;
}
public final void setMapOfEnumToEnum(Map<String, String> mapOfEnumToEnum) {
Object oldValue = this.mapOfEnumToEnum;
this.mapOfEnumToEnum = MapOfEnumToEnumCopier.copy(mapOfEnumToEnum);
handleUnionValueChange(Type.MAP_OF_ENUM_TO_ENUM, oldValue, this.mapOfEnumToEnum);
}
@Override
public final Builder mapOfEnumToEnumWithStrings(Map<String, String> mapOfEnumToEnum) {
Object oldValue = this.mapOfEnumToEnum;
this.mapOfEnumToEnum = MapOfEnumToEnumCopier.copy(mapOfEnumToEnum);
handleUnionValueChange(Type.MAP_OF_ENUM_TO_ENUM, oldValue, this.mapOfEnumToEnum);
return this;
}
@Override
public final Builder mapOfEnumToEnum(Map<EnumType, EnumType> mapOfEnumToEnum) {
Object oldValue = this.mapOfEnumToEnum;
this.mapOfEnumToEnum = MapOfEnumToEnumCopier.copyEnumToString(mapOfEnumToEnum);
handleUnionValueChange(Type.MAP_OF_ENUM_TO_ENUM, oldValue, this.mapOfEnumToEnum);
return this;
}
public final Map<String, String> getMapOfEnumToString() {
if (mapOfEnumToString instanceof SdkAutoConstructMap) {
return null;
}
return mapOfEnumToString;
}
public final void setMapOfEnumToString(Map<String, String> mapOfEnumToString) {
Object oldValue = this.mapOfEnumToString;
this.mapOfEnumToString = MapOfEnumToStringCopier.copy(mapOfEnumToString);
handleUnionValueChange(Type.MAP_OF_ENUM_TO_STRING, oldValue, this.mapOfEnumToString);
}
@Override
public final Builder mapOfEnumToStringWithStrings(Map<String, String> mapOfEnumToString) {
Object oldValue = this.mapOfEnumToString;
this.mapOfEnumToString = MapOfEnumToStringCopier.copy(mapOfEnumToString);
handleUnionValueChange(Type.MAP_OF_ENUM_TO_STRING, oldValue, this.mapOfEnumToString);
return this;
}
@Override
public final Builder mapOfEnumToString(Map<EnumType, String> mapOfEnumToString) {
Object oldValue = this.mapOfEnumToString;
this.mapOfEnumToString = MapOfEnumToStringCopier.copyEnumToString(mapOfEnumToString);
handleUnionValueChange(Type.MAP_OF_ENUM_TO_STRING, oldValue, this.mapOfEnumToString);
return this;
}
public final Map<String, String> getMapOfStringToEnum() {
if (mapOfStringToEnum instanceof SdkAutoConstructMap) {
return null;
}
return mapOfStringToEnum;
}
public final void setMapOfStringToEnum(Map<String, String> mapOfStringToEnum) {
Object oldValue = this.mapOfStringToEnum;
this.mapOfStringToEnum = MapOfStringToEnumCopier.copy(mapOfStringToEnum);
handleUnionValueChange(Type.MAP_OF_STRING_TO_ENUM, oldValue, this.mapOfStringToEnum);
}
@Override
public final Builder mapOfStringToEnumWithStrings(Map<String, String> mapOfStringToEnum) {
Object oldValue = this.mapOfStringToEnum;
this.mapOfStringToEnum = MapOfStringToEnumCopier.copy(mapOfStringToEnum);
handleUnionValueChange(Type.MAP_OF_STRING_TO_ENUM, oldValue, this.mapOfStringToEnum);
return this;
}
@Override
public final Builder mapOfStringToEnum(Map<String, EnumType> mapOfStringToEnum) {
Object oldValue = this.mapOfStringToEnum;
this.mapOfStringToEnum = MapOfStringToEnumCopier.copyEnumToString(mapOfStringToEnum);
handleUnionValueChange(Type.MAP_OF_STRING_TO_ENUM, oldValue, this.mapOfStringToEnum);
return this;
}
public final Map<String, SimpleStruct.Builder> getMapOfEnumToSimpleStruct() {
Map<String, SimpleStruct.Builder> result = MapOfEnumToSimpleStructCopier.copyToBuilder(this.mapOfEnumToSimpleStruct);
if (result instanceof SdkAutoConstructMap) {
return null;
}
return result;
}
public final void setMapOfEnumToSimpleStruct(Map<String, SimpleStruct.BuilderImpl> mapOfEnumToSimpleStruct) {
Object oldValue = this.mapOfEnumToSimpleStruct;
this.mapOfEnumToSimpleStruct = MapOfEnumToSimpleStructCopier.copyFromBuilder(mapOfEnumToSimpleStruct);
handleUnionValueChange(Type.MAP_OF_ENUM_TO_SIMPLE_STRUCT, oldValue, this.mapOfEnumToSimpleStruct);
}
@Override
public final Builder mapOfEnumToSimpleStructWithStrings(Map<String, SimpleStruct> mapOfEnumToSimpleStruct) {
Object oldValue = this.mapOfEnumToSimpleStruct;
this.mapOfEnumToSimpleStruct = MapOfEnumToSimpleStructCopier.copy(mapOfEnumToSimpleStruct);
handleUnionValueChange(Type.MAP_OF_ENUM_TO_SIMPLE_STRUCT, oldValue, this.mapOfEnumToSimpleStruct);
return this;
}
@Override
public final Builder mapOfEnumToSimpleStruct(Map<EnumType, SimpleStruct> mapOfEnumToSimpleStruct) {
Object oldValue = this.mapOfEnumToSimpleStruct;
this.mapOfEnumToSimpleStruct = MapOfEnumToSimpleStructCopier.copyEnumToString(mapOfEnumToSimpleStruct);
handleUnionValueChange(Type.MAP_OF_ENUM_TO_SIMPLE_STRUCT, oldValue, this.mapOfEnumToSimpleStruct);
return this;
}
public final Map<String, ? extends Collection<String>> getMapOfEnumToListOfEnums() {
if (mapOfEnumToListOfEnums instanceof SdkAutoConstructMap) {
return null;
}
return mapOfEnumToListOfEnums;
}
public final void setMapOfEnumToListOfEnums(Map<String, ? extends Collection<String>> mapOfEnumToListOfEnums) {
Object oldValue = this.mapOfEnumToListOfEnums;
this.mapOfEnumToListOfEnums = MapOfEnumToListOfEnumsCopier.copy(mapOfEnumToListOfEnums);
handleUnionValueChange(Type.MAP_OF_ENUM_TO_LIST_OF_ENUMS, oldValue, this.mapOfEnumToListOfEnums);
}
@Override
public final Builder mapOfEnumToListOfEnumsWithStrings(Map<String, ? extends Collection<String>> mapOfEnumToListOfEnums) {
Object oldValue = this.mapOfEnumToListOfEnums;
this.mapOfEnumToListOfEnums = MapOfEnumToListOfEnumsCopier.copy(mapOfEnumToListOfEnums);
handleUnionValueChange(Type.MAP_OF_ENUM_TO_LIST_OF_ENUMS, oldValue, this.mapOfEnumToListOfEnums);
return this;
}
@Override
public final Builder mapOfEnumToListOfEnums(Map<EnumType, ? extends Collection<EnumType>> mapOfEnumToListOfEnums) {
Object oldValue = this.mapOfEnumToListOfEnums;
this.mapOfEnumToListOfEnums = MapOfEnumToListOfEnumsCopier.copyEnumToString(mapOfEnumToListOfEnums);
handleUnionValueChange(Type.MAP_OF_ENUM_TO_LIST_OF_ENUMS, oldValue, this.mapOfEnumToListOfEnums);
return this;
}
public final Map<String, ? extends Map<String, String>> getMapOfEnumToMapOfStringToEnum() {
if (mapOfEnumToMapOfStringToEnum instanceof SdkAutoConstructMap) {
return null;
}
return mapOfEnumToMapOfStringToEnum;
}
public final void setMapOfEnumToMapOfStringToEnum(Map<String, ? extends Map<String, String>> mapOfEnumToMapOfStringToEnum) {
Object oldValue = this.mapOfEnumToMapOfStringToEnum;
this.mapOfEnumToMapOfStringToEnum = MapOfEnumToMapOfStringToEnumCopier.copy(mapOfEnumToMapOfStringToEnum);
handleUnionValueChange(Type.MAP_OF_ENUM_TO_MAP_OF_STRING_TO_ENUM, oldValue, this.mapOfEnumToMapOfStringToEnum);
}
@Override
public final Builder mapOfEnumToMapOfStringToEnumWithStrings(
Map<String, ? extends Map<String, String>> mapOfEnumToMapOfStringToEnum) {
Object oldValue = this.mapOfEnumToMapOfStringToEnum;
this.mapOfEnumToMapOfStringToEnum = MapOfEnumToMapOfStringToEnumCopier.copy(mapOfEnumToMapOfStringToEnum);
handleUnionValueChange(Type.MAP_OF_ENUM_TO_MAP_OF_STRING_TO_ENUM, oldValue, this.mapOfEnumToMapOfStringToEnum);
return this;
}
@Override
public final Builder mapOfEnumToMapOfStringToEnum(
Map<EnumType, ? extends Map<String, EnumType>> mapOfEnumToMapOfStringToEnum) {
Object oldValue = this.mapOfEnumToMapOfStringToEnum;
this.mapOfEnumToMapOfStringToEnum = MapOfEnumToMapOfStringToEnumCopier.copyEnumToString(mapOfEnumToMapOfStringToEnum);
handleUnionValueChange(Type.MAP_OF_ENUM_TO_MAP_OF_STRING_TO_ENUM, oldValue, this.mapOfEnumToMapOfStringToEnum);
return this;
}
public final Instant getTimestampMember() {
return timestampMember;
}
public final void setTimestampMember(Instant timestampMember) {
Object oldValue = this.timestampMember;
this.timestampMember = timestampMember;
handleUnionValueChange(Type.TIMESTAMP_MEMBER, oldValue, this.timestampMember);
}
@Override
public final Builder timestampMember(Instant timestampMember) {
Object oldValue = this.timestampMember;
this.timestampMember = timestampMember;
handleUnionValueChange(Type.TIMESTAMP_MEMBER, oldValue, this.timestampMember);
return this;
}
public final StructWithTimestamp.Builder getStructWithNestedTimestampMember() {
return structWithNestedTimestampMember != null ? structWithNestedTimestampMember.toBuilder() : null;
}
public final void setStructWithNestedTimestampMember(StructWithTimestamp.BuilderImpl structWithNestedTimestampMember) {
Object oldValue = this.structWithNestedTimestampMember;
this.structWithNestedTimestampMember = structWithNestedTimestampMember != null ? structWithNestedTimestampMember
.build() : null;
handleUnionValueChange(Type.STRUCT_WITH_NESTED_TIMESTAMP_MEMBER, oldValue, this.structWithNestedTimestampMember);
}
@Override
public final Builder structWithNestedTimestampMember(StructWithTimestamp structWithNestedTimestampMember) {
Object oldValue = this.structWithNestedTimestampMember;
this.structWithNestedTimestampMember = structWithNestedTimestampMember;
handleUnionValueChange(Type.STRUCT_WITH_NESTED_TIMESTAMP_MEMBER, oldValue, this.structWithNestedTimestampMember);
return this;
}
public final ByteBuffer getBlobArg() {
return blobArg == null ? null : blobArg.asByteBuffer();
}
public final void setBlobArg(ByteBuffer blobArg) {
blobArg(blobArg == null ? null : SdkBytes.fromByteBuffer(blobArg));
}
@Override
public final Builder blobArg(SdkBytes blobArg) {
Object oldValue = this.blobArg;
this.blobArg = blobArg;
handleUnionValueChange(Type.BLOB_ARG, oldValue, this.blobArg);
return this;
}
public final StructWithNestedBlobType.Builder getStructWithNestedBlob() {
return structWithNestedBlob != null ? structWithNestedBlob.toBuilder() : null;
}
public final void setStructWithNestedBlob(StructWithNestedBlobType.BuilderImpl structWithNestedBlob) {
Object oldValue = this.structWithNestedBlob;
this.structWithNestedBlob = structWithNestedBlob != null ? structWithNestedBlob.build() : null;
handleUnionValueChange(Type.STRUCT_WITH_NESTED_BLOB, oldValue, this.structWithNestedBlob);
}
@Override
public final Builder structWithNestedBlob(StructWithNestedBlobType structWithNestedBlob) {
Object oldValue = this.structWithNestedBlob;
this.structWithNestedBlob = structWithNestedBlob;
handleUnionValueChange(Type.STRUCT_WITH_NESTED_BLOB, oldValue, this.structWithNestedBlob);
return this;
}
public final Map<String, ByteBuffer> getBlobMap() {
if (blobMap instanceof SdkAutoConstructMap) {
return null;
}
return blobMap == null ? null : blobMap.entrySet().stream()
.collect(Collectors.toMap(e -> e.getKey(), e -> e.getValue().asByteBuffer()));
}
public final void setBlobMap(Map<String, ByteBuffer> blobMap) {
blobMap(blobMap == null ? null : blobMap.entrySet().stream()
.collect(Collectors.toMap(e -> e.getKey(), e -> SdkBytes.fromByteBuffer(e.getValue()))));
}
@Override
public final Builder blobMap(Map<String, SdkBytes> blobMap) {
Object oldValue = this.blobMap;
this.blobMap = BlobMapTypeCopier.copy(blobMap);
handleUnionValueChange(Type.BLOB_MAP, oldValue, this.blobMap);
return this;
}
public final List<ByteBuffer> getListOfBlobs() {
if (listOfBlobs instanceof SdkAutoConstructList) {
return null;
}
return listOfBlobs == null ? null : listOfBlobs.stream().map(SdkBytes::asByteBuffer).collect(Collectors.toList());
}
public final void setListOfBlobs(Collection<ByteBuffer> listOfBlobs) {
listOfBlobs(listOfBlobs == null ? null : listOfBlobs.stream().map(SdkBytes::fromByteBuffer)
.collect(Collectors.toList()));
}
@Override
public final Builder listOfBlobs(Collection<SdkBytes> listOfBlobs) {
Object oldValue = this.listOfBlobs;
this.listOfBlobs = ListOfBlobsTypeCopier.copy(listOfBlobs);
handleUnionValueChange(Type.LIST_OF_BLOBS, oldValue, this.listOfBlobs);
return this;
}
@Override
@SafeVarargs
public final Builder listOfBlobs(SdkBytes... listOfBlobs) {
listOfBlobs(Arrays.asList(listOfBlobs));
return this;
}
public final RecursiveStructType.Builder getRecursiveStruct() {
return recursiveStruct != null ? recursiveStruct.toBuilder() : null;
}
public final void setRecursiveStruct(RecursiveStructType.BuilderImpl recursiveStruct) {
Object oldValue = this.recursiveStruct;
this.recursiveStruct = recursiveStruct != null ? recursiveStruct.build() : null;
handleUnionValueChange(Type.RECURSIVE_STRUCT, oldValue, this.recursiveStruct);
}
@Override
public final Builder recursiveStruct(RecursiveStructType recursiveStruct) {
Object oldValue = this.recursiveStruct;
this.recursiveStruct = recursiveStruct;
handleUnionValueChange(Type.RECURSIVE_STRUCT, oldValue, this.recursiveStruct);
return this;
}
public final BaseType.Builder getPolymorphicTypeWithSubTypes() {
return polymorphicTypeWithSubTypes != null ? polymorphicTypeWithSubTypes.toBuilder() : null;
}
public final void setPolymorphicTypeWithSubTypes(BaseType.BuilderImpl polymorphicTypeWithSubTypes) {
Object oldValue = this.polymorphicTypeWithSubTypes;
this.polymorphicTypeWithSubTypes = polymorphicTypeWithSubTypes != null ? polymorphicTypeWithSubTypes.build() : null;
handleUnionValueChange(Type.POLYMORPHIC_TYPE_WITH_SUB_TYPES, oldValue, this.polymorphicTypeWithSubTypes);
}
@Override
public final Builder polymorphicTypeWithSubTypes(BaseType polymorphicTypeWithSubTypes) {
Object oldValue = this.polymorphicTypeWithSubTypes;
this.polymorphicTypeWithSubTypes = polymorphicTypeWithSubTypes;
handleUnionValueChange(Type.POLYMORPHIC_TYPE_WITH_SUB_TYPES, oldValue, this.polymorphicTypeWithSubTypes);
return this;
}
public final SubTypeOne.Builder getPolymorphicTypeWithoutSubTypes() {
return polymorphicTypeWithoutSubTypes != null ? polymorphicTypeWithoutSubTypes.toBuilder() : null;
}
public final void setPolymorphicTypeWithoutSubTypes(SubTypeOne.BuilderImpl polymorphicTypeWithoutSubTypes) {
Object oldValue = this.polymorphicTypeWithoutSubTypes;
this.polymorphicTypeWithoutSubTypes = polymorphicTypeWithoutSubTypes != null ? polymorphicTypeWithoutSubTypes.build()
: null;
handleUnionValueChange(Type.POLYMORPHIC_TYPE_WITHOUT_SUB_TYPES, oldValue, this.polymorphicTypeWithoutSubTypes);
}
@Override
public final Builder polymorphicTypeWithoutSubTypes(SubTypeOne polymorphicTypeWithoutSubTypes) {
Object oldValue = this.polymorphicTypeWithoutSubTypes;
this.polymorphicTypeWithoutSubTypes = polymorphicTypeWithoutSubTypes;
handleUnionValueChange(Type.POLYMORPHIC_TYPE_WITHOUT_SUB_TYPES, oldValue, this.polymorphicTypeWithoutSubTypes);
return this;
}
public final String getEnumType() {
return enumType;
}
public final void setEnumType(String enumType) {
Object oldValue = this.enumType;
this.enumType = enumType;
handleUnionValueChange(Type.ENUM_TYPE, oldValue, this.enumType);
}
@Override
public final Builder enumType(String enumType) {
Object oldValue = this.enumType;
this.enumType = enumType;
handleUnionValueChange(Type.ENUM_TYPE, oldValue, this.enumType);
return this;
}
@Override
public final Builder enumType(EnumType enumType) {
this.enumType(enumType == null ? null : enumType.toString());
return this;
}
public final Underscore_Name_Type.Builder getUnderscore_Name_Type() {
return underscore_Name_Type != null ? underscore_Name_Type.toBuilder() : null;
}
public final void setUnderscore_Name_Type(Underscore_Name_Type.BuilderImpl underscore_Name_Type) {
Object oldValue = this.underscore_Name_Type;
this.underscore_Name_Type = underscore_Name_Type != null ? underscore_Name_Type.build() : null;
handleUnionValueChange(Type.UNDERSCORE_NAME_TYPE, oldValue, this.underscore_Name_Type);
}
@Override
public final Builder underscore_Name_Type(Underscore_Name_Type underscore_Name_Type) {
Object oldValue = this.underscore_Name_Type;
this.underscore_Name_Type = underscore_Name_Type;
handleUnionValueChange(Type.UNDERSCORE_NAME_TYPE, oldValue, this.underscore_Name_Type);
return this;
}
public final Document getMyDocument() {
return myDocument;
}
public final void setMyDocument(Document myDocument) {
Object oldValue = this.myDocument;
this.myDocument = myDocument;
handleUnionValueChange(Type.MY_DOCUMENT, oldValue, this.myDocument);
}
@Override
public final Builder myDocument(Document myDocument) {
Object oldValue = this.myDocument;
this.myDocument = myDocument;
handleUnionValueChange(Type.MY_DOCUMENT, oldValue, this.myDocument);
return this;
}
public final Builder getAllTypesUnionStructure() {
return allTypesUnionStructure != null ? allTypesUnionStructure.toBuilder() : null;
}
public final void setAllTypesUnionStructure(BuilderImpl allTypesUnionStructure) {
Object oldValue = this.allTypesUnionStructure;
this.allTypesUnionStructure = allTypesUnionStructure != null ? allTypesUnionStructure.build() : null;
handleUnionValueChange(Type.ALL_TYPES_UNION_STRUCTURE, oldValue, this.allTypesUnionStructure);
}
@Override
public final Builder allTypesUnionStructure(AllTypesUnionStructure allTypesUnionStructure) {
Object oldValue = this.allTypesUnionStructure;
this.allTypesUnionStructure = allTypesUnionStructure;
handleUnionValueChange(Type.ALL_TYPES_UNION_STRUCTURE, oldValue, this.allTypesUnionStructure);
return this;
}
@Override
public AllTypesUnionStructure build() {
return new AllTypesUnionStructure(this);
}
@Override
public List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
private final void handleUnionValueChange(Type type, Object oldValue, Object newValue) {
if (this.type == type || oldValue == newValue) {
return;
}
if (newValue == null || newValue instanceof SdkAutoConstructList || newValue instanceof SdkAutoConstructMap) {
setTypes.remove(type);
} else if (oldValue == null || oldValue instanceof SdkAutoConstructList || oldValue instanceof SdkAutoConstructMap) {
setTypes.add(type);
}
if (setTypes.size() == 1) {
this.type = setTypes.iterator().next();
} else if (setTypes.isEmpty()) {
this.type = Type.UNKNOWN_TO_SDK_VERSION;
} else {
this.type = null;
}
}
}
/**
* @see AllTypesUnionStructure#type()
*/
public enum Type {
STRING_MEMBER,
INTEGER_MEMBER,
BOOLEAN_MEMBER,
FLOAT_MEMBER,
DOUBLE_MEMBER,
LONG_MEMBER,
SHORT_MEMBER,
SIMPLE_LIST,
LIST_OF_ENUMS,
LIST_OF_MAPS,
LIST_OF_STRUCTS,
LIST_OF_MAP_OF_ENUM_TO_STRING,
LIST_OF_MAP_OF_STRING_TO_STRUCT,
MAP_OF_STRING_TO_INTEGER_LIST,
MAP_OF_STRING_TO_STRING,
MAP_OF_STRING_TO_SIMPLE_STRUCT,
MAP_OF_ENUM_TO_ENUM,
MAP_OF_ENUM_TO_STRING,
MAP_OF_STRING_TO_ENUM,
MAP_OF_ENUM_TO_SIMPLE_STRUCT,
MAP_OF_ENUM_TO_LIST_OF_ENUMS,
MAP_OF_ENUM_TO_MAP_OF_STRING_TO_ENUM,
TIMESTAMP_MEMBER,
STRUCT_WITH_NESTED_TIMESTAMP_MEMBER,
BLOB_ARG,
STRUCT_WITH_NESTED_BLOB,
BLOB_MAP,
LIST_OF_BLOBS,
RECURSIVE_STRUCT,
POLYMORPHIC_TYPE_WITH_SUB_TYPES,
POLYMORPHIC_TYPE_WITHOUT_SUB_TYPES,
ENUM_TYPE,
UNDERSCORE_NAME_TYPE,
MY_DOCUMENT,
ALL_TYPES_UNION_STRUCTURE,
UNKNOWN_TO_SDK_VERSION
}
}
| 3,460 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/existencechecknamingrequest.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
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.AwsRequestOverrideConfiguration;
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.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.traits.MapTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class ExistenceCheckNamingRequest extends JsonProtocolTestsRequest implements
ToCopyableBuilder<ExistenceCheckNamingRequest.Builder, ExistenceCheckNamingRequest> {
private static final SdkField<List<String>> BUILD_FIELD = SdkField
.<List<String>> builder(MarshallingType.LIST)
.memberName("Build")
.getter(getter(ExistenceCheckNamingRequest::build))
.setter(setter(Builder::build))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Build").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField<List<String>> SUPER_FIELD = SdkField
.<List<String>> builder(MarshallingType.LIST)
.memberName("super")
.getter(getter(ExistenceCheckNamingRequest::superValue))
.setter(setter(Builder::superValue))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("super").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField<Map<String, String>> TO_STRING_FIELD = SdkField
.<Map<String, String>> builder(MarshallingType.MAP)
.memberName("toString")
.getter(getter(ExistenceCheckNamingRequest::toStringValue))
.setter(setter(Builder::toStringValue))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("toString").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build()).build()).build();
private static final SdkField<Map<String, String>> EQUALS_FIELD = SdkField
.<Map<String, String>> builder(MarshallingType.MAP)
.memberName("equals")
.getter(getter(ExistenceCheckNamingRequest::equalsValue))
.setter(setter(Builder::equalsValue))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("equals").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build()).build()).build();
private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(BUILD_FIELD, SUPER_FIELD,
TO_STRING_FIELD, EQUALS_FIELD));
private final List<String> build;
private final List<String> superValue;
private final Map<String, String> toStringValue;
private final Map<String, String> equalsValue;
private ExistenceCheckNamingRequest(BuilderImpl builder) {
super(builder);
this.build = builder.build;
this.superValue = builder.superValue;
this.toStringValue = builder.toStringValue;
this.equalsValue = builder.equalsValue;
}
/**
* For responses, this returns true if the service returned a value for the Build property. This DOES NOT check that
* the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is useful
* because the SDK will never return a null collection or map, but you may need to differentiate between the service
* returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true
* if a value for the property was specified in the request builder, and false if a value was not specified.
*/
public final boolean hasBuild() {
return build != null && !(build instanceof SdkAutoConstructList);
}
/**
* Returns the value of the Build property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasBuild} method.
* </p>
*
* @return The value of the Build property for this object.
*/
public final List<String> build() {
return build;
}
/**
* For responses, this returns true if the service returned a value for the Super property. This DOES NOT check that
* the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is useful
* because the SDK will never return a null collection or map, but you may need to differentiate between the service
* returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true
* if a value for the property was specified in the request builder, and false if a value was not specified.
*/
public final boolean hasSuperValue() {
return superValue != null && !(superValue instanceof SdkAutoConstructList);
}
/**
* Returns the value of the Super property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasSuperValue} method.
* </p>
*
* @return The value of the Super property for this object.
*/
public final List<String> superValue() {
return superValue;
}
/**
* For responses, this returns true if the service returned a value for the ToString property. This DOES NOT check
* that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is
* useful because the SDK will never return a null collection or map, but you may need to differentiate between the
* service returning nothing (or null) and the service returning an empty collection or map. For requests, this
* returns true if a value for the property was specified in the request builder, and false if a value was not
* specified.
*/
public final boolean hasToStringValue() {
return toStringValue != null && !(toStringValue instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the ToString property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasToStringValue} method.
* </p>
*
* @return The value of the ToString property for this object.
*/
public final Map<String, String> toStringValue() {
return toStringValue;
}
/**
* For responses, this returns true if the service returned a value for the Equals property. This DOES NOT check
* that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is
* useful because the SDK will never return a null collection or map, but you may need to differentiate between the
* service returning nothing (or null) and the service returning an empty collection or map. For requests, this
* returns true if a value for the property was specified in the request builder, and false if a value was not
* specified.
*/
public final boolean hasEqualsValue() {
return equalsValue != null && !(equalsValue instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the Equals property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasEqualsValue} method.
* </p>
*
* @return The value of the Equals property for this object.
*/
public final Map<String, String> equalsValue() {
return equalsValue;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class<? extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
hashCode = 31 * hashCode + Objects.hashCode(hasBuild() ? build() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasSuperValue() ? superValue() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasToStringValue() ? toStringValue() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasEqualsValue() ? equalsValue() : null);
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof ExistenceCheckNamingRequest)) {
return false;
}
ExistenceCheckNamingRequest other = (ExistenceCheckNamingRequest) obj;
return hasBuild() == other.hasBuild() && Objects.equals(build(), other.build())
&& hasSuperValue() == other.hasSuperValue() && Objects.equals(superValue(), other.superValue())
&& hasToStringValue() == other.hasToStringValue() && Objects.equals(toStringValue(), other.toStringValue())
&& hasEqualsValue() == other.hasEqualsValue() && Objects.equals(equalsValue(), other.equalsValue());
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("ExistenceCheckNamingRequest").add("Build", hasBuild() ? build() : null)
.add("Super", hasSuperValue() ? superValue() : null).add("ToString", hasToStringValue() ? toStringValue() : null)
.add("Equals", hasEqualsValue() ? equalsValue() : null).build();
}
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
switch (fieldName) {
case "Build":
return Optional.ofNullable(clazz.cast(build()));
case "super":
return Optional.ofNullable(clazz.cast(superValue()));
case "toString":
return Optional.ofNullable(clazz.cast(toStringValue()));
case "equals":
return Optional.ofNullable(clazz.cast(equalsValue()));
default:
return Optional.empty();
}
}
@Override
public final List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
private static <T> Function<Object, T> getter(Function<ExistenceCheckNamingRequest, T> g) {
return obj -> g.apply((ExistenceCheckNamingRequest) obj);
}
private static <T> BiConsumer<Object, T> setter(BiConsumer<Builder, T> s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
public interface Builder extends JsonProtocolTestsRequest.Builder, SdkPojo,
CopyableBuilder<Builder, ExistenceCheckNamingRequest> {
/**
* Sets the value of the Build property for this object.
*
* @param build
* The new value for the Build property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder build(Collection<String> build);
/**
* Sets the value of the Build property for this object.
*
* @param build
* The new value for the Build property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder build(String... build);
/**
* Sets the value of the Super property for this object.
*
* @param superValue
* The new value for the Super property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder superValue(Collection<String> superValue);
/**
* Sets the value of the Super property for this object.
*
* @param superValue
* The new value for the Super property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder superValue(String... superValue);
/**
* Sets the value of the ToString property for this object.
*
* @param toStringValue
* The new value for the ToString property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder toStringValue(Map<String, String> toStringValue);
/**
* Sets the value of the Equals property for this object.
*
* @param equalsValue
* The new value for the Equals property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder equalsValue(Map<String, String> equalsValue);
@Override
Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration);
@Override
Builder overrideConfiguration(Consumer<AwsRequestOverrideConfiguration.Builder> builderConsumer);
}
static final class BuilderImpl extends JsonProtocolTestsRequest.BuilderImpl implements Builder {
private List<String> build = DefaultSdkAutoConstructList.getInstance();
private List<String> superValue = DefaultSdkAutoConstructList.getInstance();
private Map<String, String> toStringValue = DefaultSdkAutoConstructMap.getInstance();
private Map<String, String> equalsValue = DefaultSdkAutoConstructMap.getInstance();
private BuilderImpl() {
}
private BuilderImpl(ExistenceCheckNamingRequest model) {
super(model);
build(model.build);
superValue(model.superValue);
toStringValue(model.toStringValue);
equalsValue(model.equalsValue);
}
public final Collection<String> getBuild() {
if (build instanceof SdkAutoConstructList) {
return null;
}
return build;
}
public final void setBuild(Collection<String> build) {
this.build = ListOfStringsCopier.copy(build);
}
@Override
public final Builder build(Collection<String> build) {
this.build = ListOfStringsCopier.copy(build);
return this;
}
@Override
@SafeVarargs
public final Builder build(String... build) {
build(Arrays.asList(build));
return this;
}
public final Collection<String> getSuperValue() {
if (superValue instanceof SdkAutoConstructList) {
return null;
}
return superValue;
}
public final void setSuperValue(Collection<String> superValue) {
this.superValue = ListOfStringsCopier.copy(superValue);
}
@Override
public final Builder superValue(Collection<String> superValue) {
this.superValue = ListOfStringsCopier.copy(superValue);
return this;
}
@Override
@SafeVarargs
public final Builder superValue(String... superValue) {
superValue(Arrays.asList(superValue));
return this;
}
public final Map<String, String> getToStringValue() {
if (toStringValue instanceof SdkAutoConstructMap) {
return null;
}
return toStringValue;
}
public final void setToStringValue(Map<String, String> toStringValue) {
this.toStringValue = MapOfStringToStringCopier.copy(toStringValue);
}
@Override
public final Builder toStringValue(Map<String, String> toStringValue) {
this.toStringValue = MapOfStringToStringCopier.copy(toStringValue);
return this;
}
public final Map<String, String> getEqualsValue() {
if (equalsValue instanceof SdkAutoConstructMap) {
return null;
}
return equalsValue;
}
public final void setEqualsValue(Map<String, String> equalsValue) {
this.equalsValue = MapOfStringToStringCopier.copy(equalsValue);
}
@Override
public final Builder equalsValue(Map<String, String> equalsValue) {
this.equalsValue = MapOfStringToStringCopier.copy(equalsValue);
return this;
}
@Override
public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) {
super.overrideConfiguration(overrideConfiguration);
return this;
}
@Override
public Builder overrideConfiguration(Consumer<AwsRequestOverrideConfiguration.Builder> builderConsumer) {
super.overrideConfiguration(builderConsumer);
return this;
}
@Override
public ExistenceCheckNamingRequest build() {
return new ExistenceCheckNamingRequest(this);
}
@Override
public List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
}
}
| 3,461 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/alltypesrequest.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import java.nio.ByteBuffer;
import java.time.Instant;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
import software.amazon.awssdk.core.SdkBytes;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.document.Document;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.traits.MapTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class AllTypesRequest extends JsonProtocolTestsRequest implements
ToCopyableBuilder<AllTypesRequest.Builder, AllTypesRequest> {
private static final SdkField<String> STRING_MEMBER_FIELD = SdkField.<String> builder(MarshallingType.STRING)
.memberName("StringMember").getter(getter(AllTypesRequest::stringMember)).setter(setter(Builder::stringMember))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StringMember").build()).build();
private static final SdkField<Integer> INTEGER_MEMBER_FIELD = SdkField.<Integer> builder(MarshallingType.INTEGER)
.memberName("IntegerMember").getter(getter(AllTypesRequest::integerMember)).setter(setter(Builder::integerMember))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("IntegerMember").build()).build();
private static final SdkField<Boolean> BOOLEAN_MEMBER_FIELD = SdkField.<Boolean> builder(MarshallingType.BOOLEAN)
.memberName("BooleanMember").getter(getter(AllTypesRequest::booleanMember)).setter(setter(Builder::booleanMember))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("BooleanMember").build()).build();
private static final SdkField<Float> FLOAT_MEMBER_FIELD = SdkField.<Float> builder(MarshallingType.FLOAT)
.memberName("FloatMember").getter(getter(AllTypesRequest::floatMember)).setter(setter(Builder::floatMember))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("FloatMember").build()).build();
private static final SdkField<Double> DOUBLE_MEMBER_FIELD = SdkField.<Double> builder(MarshallingType.DOUBLE)
.memberName("DoubleMember").getter(getter(AllTypesRequest::doubleMember)).setter(setter(Builder::doubleMember))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DoubleMember").build()).build();
private static final SdkField<Long> LONG_MEMBER_FIELD = SdkField.<Long> builder(MarshallingType.LONG)
.memberName("LongMember").getter(getter(AllTypesRequest::longMember)).setter(setter(Builder::longMember))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LongMember").build()).build();
private static final SdkField<Short> SHORT_MEMBER_FIELD = SdkField.<Short> builder(MarshallingType.SHORT)
.memberName("ShortMember").getter(getter(AllTypesRequest::shortMember)).setter(setter(Builder::shortMember))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ShortMember").build()).build();
private static final SdkField<List<String>> SIMPLE_LIST_FIELD = SdkField
.<List<String>> builder(MarshallingType.LIST)
.memberName("SimpleList")
.getter(getter(AllTypesRequest::simpleList))
.setter(setter(Builder::simpleList))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SimpleList").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField<List<String>> LIST_OF_ENUMS_FIELD = SdkField
.<List<String>> builder(MarshallingType.LIST)
.memberName("ListOfEnums")
.getter(getter(AllTypesRequest::listOfEnumsAsStrings))
.setter(setter(Builder::listOfEnumsWithStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ListOfEnums").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField<List<Map<String, String>>> LIST_OF_MAPS_FIELD = SdkField
.<List<Map<String, String>>> builder(MarshallingType.LIST)
.memberName("ListOfMaps")
.getter(getter(AllTypesRequest::listOfMaps))
.setter(setter(Builder::listOfMaps))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ListOfMaps").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<Map<String, String>> builder(MarshallingType.MAP)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder()
.location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build())
.build()).build()).build()).build();
private static final SdkField<List<SimpleStruct>> LIST_OF_STRUCTS_FIELD = SdkField
.<List<SimpleStruct>> builder(MarshallingType.LIST)
.memberName("ListOfStructs")
.getter(getter(AllTypesRequest::listOfStructs))
.setter(setter(Builder::listOfStructs))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ListOfStructs").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<SimpleStruct> builder(MarshallingType.SDK_POJO)
.constructor(SimpleStruct::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField<List<Map<String, String>>> LIST_OF_MAP_OF_ENUM_TO_STRING_FIELD = SdkField
.<List<Map<String, String>>> builder(MarshallingType.LIST)
.memberName("ListOfMapOfEnumToString")
.getter(getter(AllTypesRequest::listOfMapOfEnumToStringAsStrings))
.setter(setter(Builder::listOfMapOfEnumToStringWithStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ListOfMapOfEnumToString").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<Map<String, String>> builder(MarshallingType.MAP)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder()
.location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build())
.build()).build()).build()).build();
private static final SdkField<List<Map<String, SimpleStruct>>> LIST_OF_MAP_OF_STRING_TO_STRUCT_FIELD = SdkField
.<List<Map<String, SimpleStruct>>> builder(MarshallingType.LIST)
.memberName("ListOfMapOfStringToStruct")
.getter(getter(AllTypesRequest::listOfMapOfStringToStruct))
.setter(setter(Builder::listOfMapOfStringToStruct))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ListOfMapOfStringToStruct").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<Map<String, SimpleStruct>> builder(MarshallingType.MAP)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<SimpleStruct> builder(MarshallingType.SDK_POJO)
.constructor(SimpleStruct::builder)
.traits(LocationTrait.builder()
.location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build())
.build()).build()).build()).build();
private static final SdkField<Map<String, List<Integer>>> MAP_OF_STRING_TO_INTEGER_LIST_FIELD = SdkField
.<Map<String, List<Integer>>> builder(MarshallingType.MAP)
.memberName("MapOfStringToIntegerList")
.getter(getter(AllTypesRequest::mapOfStringToIntegerList))
.setter(setter(Builder::mapOfStringToIntegerList))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MapOfStringToIntegerList").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<List<Integer>> builder(MarshallingType.LIST)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<Integer> builder(MarshallingType.INTEGER)
.traits(LocationTrait.builder()
.location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build())
.build()).build()).build()).build();
private static final SdkField<Map<String, String>> MAP_OF_STRING_TO_STRING_FIELD = SdkField
.<Map<String, String>> builder(MarshallingType.MAP)
.memberName("MapOfStringToString")
.getter(getter(AllTypesRequest::mapOfStringToString))
.setter(setter(Builder::mapOfStringToString))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MapOfStringToString").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build()).build()).build();
private static final SdkField<Map<String, SimpleStruct>> MAP_OF_STRING_TO_SIMPLE_STRUCT_FIELD = SdkField
.<Map<String, SimpleStruct>> builder(MarshallingType.MAP)
.memberName("MapOfStringToSimpleStruct")
.getter(getter(AllTypesRequest::mapOfStringToSimpleStruct))
.setter(setter(Builder::mapOfStringToSimpleStruct))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MapOfStringToSimpleStruct").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<SimpleStruct> builder(MarshallingType.SDK_POJO)
.constructor(SimpleStruct::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build()).build()).build();
private static final SdkField<Map<String, String>> MAP_OF_ENUM_TO_ENUM_FIELD = SdkField
.<Map<String, String>> builder(MarshallingType.MAP)
.memberName("MapOfEnumToEnum")
.getter(getter(AllTypesRequest::mapOfEnumToEnumAsStrings))
.setter(setter(Builder::mapOfEnumToEnumWithStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MapOfEnumToEnum").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build()).build()).build();
private static final SdkField<Map<String, String>> MAP_OF_ENUM_TO_STRING_FIELD = SdkField
.<Map<String, String>> builder(MarshallingType.MAP)
.memberName("MapOfEnumToString")
.getter(getter(AllTypesRequest::mapOfEnumToStringAsStrings))
.setter(setter(Builder::mapOfEnumToStringWithStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MapOfEnumToString").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build()).build()).build();
private static final SdkField<Map<String, String>> MAP_OF_STRING_TO_ENUM_FIELD = SdkField
.<Map<String, String>> builder(MarshallingType.MAP)
.memberName("MapOfStringToEnum")
.getter(getter(AllTypesRequest::mapOfStringToEnumAsStrings))
.setter(setter(Builder::mapOfStringToEnumWithStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MapOfStringToEnum").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build()).build()).build();
private static final SdkField<Map<String, SimpleStruct>> MAP_OF_ENUM_TO_SIMPLE_STRUCT_FIELD = SdkField
.<Map<String, SimpleStruct>> builder(MarshallingType.MAP)
.memberName("MapOfEnumToSimpleStruct")
.getter(getter(AllTypesRequest::mapOfEnumToSimpleStructAsStrings))
.setter(setter(Builder::mapOfEnumToSimpleStructWithStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MapOfEnumToSimpleStruct").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<SimpleStruct> builder(MarshallingType.SDK_POJO)
.constructor(SimpleStruct::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build()).build()).build();
private static final SdkField<Map<String, List<String>>> MAP_OF_ENUM_TO_LIST_OF_ENUMS_FIELD = SdkField
.<Map<String, List<String>>> builder(MarshallingType.MAP)
.memberName("MapOfEnumToListOfEnums")
.getter(getter(AllTypesRequest::mapOfEnumToListOfEnumsAsStrings))
.setter(setter(Builder::mapOfEnumToListOfEnumsWithStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MapOfEnumToListOfEnums").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<List<String>> builder(MarshallingType.LIST)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder()
.location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build())
.build()).build()).build()).build();
private static final SdkField<Map<String, Map<String, String>>> MAP_OF_ENUM_TO_MAP_OF_STRING_TO_ENUM_FIELD = SdkField
.<Map<String, Map<String, String>>> builder(MarshallingType.MAP)
.memberName("MapOfEnumToMapOfStringToEnum")
.getter(getter(AllTypesRequest::mapOfEnumToMapOfStringToEnumAsStrings))
.setter(setter(Builder::mapOfEnumToMapOfStringToEnumWithStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MapOfEnumToMapOfStringToEnum")
.build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<Map<String, String>> builder(MarshallingType.MAP)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder()
.location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build())
.build()).build()).build()).build();
private static final SdkField<Instant> TIMESTAMP_MEMBER_FIELD = SdkField.<Instant> builder(MarshallingType.INSTANT)
.memberName("TimestampMember").getter(getter(AllTypesRequest::timestampMember))
.setter(setter(Builder::timestampMember))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TimestampMember").build()).build();
private static final SdkField<StructWithTimestamp> STRUCT_WITH_NESTED_TIMESTAMP_MEMBER_FIELD = SdkField
.<StructWithTimestamp> builder(MarshallingType.SDK_POJO)
.memberName("StructWithNestedTimestampMember")
.getter(getter(AllTypesRequest::structWithNestedTimestampMember))
.setter(setter(Builder::structWithNestedTimestampMember))
.constructor(StructWithTimestamp::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StructWithNestedTimestampMember")
.build()).build();
private static final SdkField<SdkBytes> BLOB_ARG_FIELD = SdkField.<SdkBytes> builder(MarshallingType.SDK_BYTES)
.memberName("BlobArg").getter(getter(AllTypesRequest::blobArg)).setter(setter(Builder::blobArg))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("BlobArg").build()).build();
private static final SdkField<StructWithNestedBlobType> STRUCT_WITH_NESTED_BLOB_FIELD = SdkField
.<StructWithNestedBlobType> builder(MarshallingType.SDK_POJO).memberName("StructWithNestedBlob")
.getter(getter(AllTypesRequest::structWithNestedBlob)).setter(setter(Builder::structWithNestedBlob))
.constructor(StructWithNestedBlobType::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StructWithNestedBlob").build())
.build();
private static final SdkField<Map<String, SdkBytes>> BLOB_MAP_FIELD = SdkField
.<Map<String, SdkBytes>> builder(MarshallingType.MAP)
.memberName("BlobMap")
.getter(getter(AllTypesRequest::blobMap))
.setter(setter(Builder::blobMap))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("BlobMap").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<SdkBytes> builder(MarshallingType.SDK_BYTES)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build()).build()).build();
private static final SdkField<List<SdkBytes>> LIST_OF_BLOBS_FIELD = SdkField
.<List<SdkBytes>> builder(MarshallingType.LIST)
.memberName("ListOfBlobs")
.getter(getter(AllTypesRequest::listOfBlobs))
.setter(setter(Builder::listOfBlobs))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ListOfBlobs").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<SdkBytes> builder(MarshallingType.SDK_BYTES)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField<RecursiveStructType> RECURSIVE_STRUCT_FIELD = SdkField
.<RecursiveStructType> builder(MarshallingType.SDK_POJO).memberName("RecursiveStruct")
.getter(getter(AllTypesRequest::recursiveStruct)).setter(setter(Builder::recursiveStruct))
.constructor(RecursiveStructType::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RecursiveStruct").build()).build();
private static final SdkField<BaseType> POLYMORPHIC_TYPE_WITH_SUB_TYPES_FIELD = SdkField
.<BaseType> builder(MarshallingType.SDK_POJO)
.memberName("PolymorphicTypeWithSubTypes")
.getter(getter(AllTypesRequest::polymorphicTypeWithSubTypes))
.setter(setter(Builder::polymorphicTypeWithSubTypes))
.constructor(BaseType::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("PolymorphicTypeWithSubTypes")
.build()).build();
private static final SdkField<SubTypeOne> POLYMORPHIC_TYPE_WITHOUT_SUB_TYPES_FIELD = SdkField
.<SubTypeOne> builder(MarshallingType.SDK_POJO)
.memberName("PolymorphicTypeWithoutSubTypes")
.getter(getter(AllTypesRequest::polymorphicTypeWithoutSubTypes))
.setter(setter(Builder::polymorphicTypeWithoutSubTypes))
.constructor(SubTypeOne::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("PolymorphicTypeWithoutSubTypes")
.build()).build();
private static final SdkField<String> ENUM_TYPE_FIELD = SdkField.<String> builder(MarshallingType.STRING)
.memberName("EnumType").getter(getter(AllTypesRequest::enumTypeAsString)).setter(setter(Builder::enumType))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EnumType").build()).build();
private static final SdkField<Underscore_Name_Type> UNDERSCORE_NAME_TYPE_FIELD = SdkField
.<Underscore_Name_Type> builder(MarshallingType.SDK_POJO).memberName("Underscore_Name_Type")
.getter(getter(AllTypesRequest::underscore_Name_Type)).setter(setter(Builder::underscore_Name_Type))
.constructor(Underscore_Name_Type::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Underscore_Name_Type").build())
.build();
private static final SdkField<Document> MY_DOCUMENT_FIELD = SdkField.<Document> builder(MarshallingType.DOCUMENT)
.memberName("MyDocument").getter(getter(AllTypesRequest::myDocument)).setter(setter(Builder::myDocument))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MyDocument").build()).build();
private static final SdkField<AllTypesUnionStructure> ALL_TYPES_UNION_STRUCTURE_FIELD = SdkField
.<AllTypesUnionStructure> builder(MarshallingType.SDK_POJO).memberName("AllTypesUnionStructure")
.getter(getter(AllTypesRequest::allTypesUnionStructure)).setter(setter(Builder::allTypesUnionStructure))
.constructor(AllTypesUnionStructure::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AllTypesUnionStructure").build())
.build();
private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(STRING_MEMBER_FIELD,
INTEGER_MEMBER_FIELD, BOOLEAN_MEMBER_FIELD, FLOAT_MEMBER_FIELD, DOUBLE_MEMBER_FIELD, LONG_MEMBER_FIELD,
SHORT_MEMBER_FIELD, SIMPLE_LIST_FIELD, LIST_OF_ENUMS_FIELD, LIST_OF_MAPS_FIELD, LIST_OF_STRUCTS_FIELD,
LIST_OF_MAP_OF_ENUM_TO_STRING_FIELD, LIST_OF_MAP_OF_STRING_TO_STRUCT_FIELD, MAP_OF_STRING_TO_INTEGER_LIST_FIELD,
MAP_OF_STRING_TO_STRING_FIELD, MAP_OF_STRING_TO_SIMPLE_STRUCT_FIELD, MAP_OF_ENUM_TO_ENUM_FIELD,
MAP_OF_ENUM_TO_STRING_FIELD, MAP_OF_STRING_TO_ENUM_FIELD, MAP_OF_ENUM_TO_SIMPLE_STRUCT_FIELD,
MAP_OF_ENUM_TO_LIST_OF_ENUMS_FIELD, MAP_OF_ENUM_TO_MAP_OF_STRING_TO_ENUM_FIELD, TIMESTAMP_MEMBER_FIELD,
STRUCT_WITH_NESTED_TIMESTAMP_MEMBER_FIELD, BLOB_ARG_FIELD, STRUCT_WITH_NESTED_BLOB_FIELD, BLOB_MAP_FIELD,
LIST_OF_BLOBS_FIELD, RECURSIVE_STRUCT_FIELD, POLYMORPHIC_TYPE_WITH_SUB_TYPES_FIELD,
POLYMORPHIC_TYPE_WITHOUT_SUB_TYPES_FIELD, ENUM_TYPE_FIELD, UNDERSCORE_NAME_TYPE_FIELD, MY_DOCUMENT_FIELD,
ALL_TYPES_UNION_STRUCTURE_FIELD));
private final String stringMember;
private final Integer integerMember;
private final Boolean booleanMember;
private final Float floatMember;
private final Double doubleMember;
private final Long longMember;
private final Short shortMember;
private final List<String> simpleList;
private final List<String> listOfEnums;
private final List<Map<String, String>> listOfMaps;
private final List<SimpleStruct> listOfStructs;
private final List<Map<String, String>> listOfMapOfEnumToString;
private final List<Map<String, SimpleStruct>> listOfMapOfStringToStruct;
private final Map<String, List<Integer>> mapOfStringToIntegerList;
private final Map<String, String> mapOfStringToString;
private final Map<String, SimpleStruct> mapOfStringToSimpleStruct;
private final Map<String, String> mapOfEnumToEnum;
private final Map<String, String> mapOfEnumToString;
private final Map<String, String> mapOfStringToEnum;
private final Map<String, SimpleStruct> mapOfEnumToSimpleStruct;
private final Map<String, List<String>> mapOfEnumToListOfEnums;
private final Map<String, Map<String, String>> mapOfEnumToMapOfStringToEnum;
private final Instant timestampMember;
private final StructWithTimestamp structWithNestedTimestampMember;
private final SdkBytes blobArg;
private final StructWithNestedBlobType structWithNestedBlob;
private final Map<String, SdkBytes> blobMap;
private final List<SdkBytes> listOfBlobs;
private final RecursiveStructType recursiveStruct;
private final BaseType polymorphicTypeWithSubTypes;
private final SubTypeOne polymorphicTypeWithoutSubTypes;
private final String enumType;
private final Underscore_Name_Type underscore_Name_Type;
private final Document myDocument;
private final AllTypesUnionStructure allTypesUnionStructure;
private AllTypesRequest(BuilderImpl builder) {
super(builder);
this.stringMember = builder.stringMember;
this.integerMember = builder.integerMember;
this.booleanMember = builder.booleanMember;
this.floatMember = builder.floatMember;
this.doubleMember = builder.doubleMember;
this.longMember = builder.longMember;
this.shortMember = builder.shortMember;
this.simpleList = builder.simpleList;
this.listOfEnums = builder.listOfEnums;
this.listOfMaps = builder.listOfMaps;
this.listOfStructs = builder.listOfStructs;
this.listOfMapOfEnumToString = builder.listOfMapOfEnumToString;
this.listOfMapOfStringToStruct = builder.listOfMapOfStringToStruct;
this.mapOfStringToIntegerList = builder.mapOfStringToIntegerList;
this.mapOfStringToString = builder.mapOfStringToString;
this.mapOfStringToSimpleStruct = builder.mapOfStringToSimpleStruct;
this.mapOfEnumToEnum = builder.mapOfEnumToEnum;
this.mapOfEnumToString = builder.mapOfEnumToString;
this.mapOfStringToEnum = builder.mapOfStringToEnum;
this.mapOfEnumToSimpleStruct = builder.mapOfEnumToSimpleStruct;
this.mapOfEnumToListOfEnums = builder.mapOfEnumToListOfEnums;
this.mapOfEnumToMapOfStringToEnum = builder.mapOfEnumToMapOfStringToEnum;
this.timestampMember = builder.timestampMember;
this.structWithNestedTimestampMember = builder.structWithNestedTimestampMember;
this.blobArg = builder.blobArg;
this.structWithNestedBlob = builder.structWithNestedBlob;
this.blobMap = builder.blobMap;
this.listOfBlobs = builder.listOfBlobs;
this.recursiveStruct = builder.recursiveStruct;
this.polymorphicTypeWithSubTypes = builder.polymorphicTypeWithSubTypes;
this.polymorphicTypeWithoutSubTypes = builder.polymorphicTypeWithoutSubTypes;
this.enumType = builder.enumType;
this.underscore_Name_Type = builder.underscore_Name_Type;
this.myDocument = builder.myDocument;
this.allTypesUnionStructure = builder.allTypesUnionStructure;
}
/**
* Returns the value of the StringMember property for this object.
*
* @return The value of the StringMember property for this object.
*/
public final String stringMember() {
return stringMember;
}
/**
* Returns the value of the IntegerMember property for this object.
*
* @return The value of the IntegerMember property for this object.
*/
public final Integer integerMember() {
return integerMember;
}
/**
* Returns the value of the BooleanMember property for this object.
*
* @return The value of the BooleanMember property for this object.
*/
public final Boolean booleanMember() {
return booleanMember;
}
/**
* Returns the value of the FloatMember property for this object.
*
* @return The value of the FloatMember property for this object.
*/
public final Float floatMember() {
return floatMember;
}
/**
* Returns the value of the DoubleMember property for this object.
*
* @return The value of the DoubleMember property for this object.
*/
public final Double doubleMember() {
return doubleMember;
}
/**
* Returns the value of the LongMember property for this object.
*
* @return The value of the LongMember property for this object.
*/
public final Long longMember() {
return longMember;
}
/**
* Returns the value of the ShortMember property for this object.
*
* @return The value of the ShortMember property for this object.
*/
public final Short shortMember() {
return shortMember;
}
/**
* For responses, this returns true if the service returned a value for the SimpleList property. This DOES NOT check
* that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is
* useful because the SDK will never return a null collection or map, but you may need to differentiate between the
* service returning nothing (or null) and the service returning an empty collection or map. For requests, this
* returns true if a value for the property was specified in the request builder, and false if a value was not
* specified.
*/
public final boolean hasSimpleList() {
return simpleList != null && !(simpleList instanceof SdkAutoConstructList);
}
/**
* Returns the value of the SimpleList property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasSimpleList} method.
* </p>
*
* @return The value of the SimpleList property for this object.
*/
public final List<String> simpleList() {
return simpleList;
}
/**
* Returns the value of the ListOfEnums property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasListOfEnums} method.
* </p>
*
* @return The value of the ListOfEnums property for this object.
*/
public final List<EnumType> listOfEnums() {
return ListOfEnumsCopier.copyStringToEnum(listOfEnums);
}
/**
* For responses, this returns true if the service returned a value for the ListOfEnums property. This DOES NOT
* check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property).
* This is useful because the SDK will never return a null collection or map, but you may need to differentiate
* between the service returning nothing (or null) and the service returning an empty collection or map. For
* requests, this returns true if a value for the property was specified in the request builder, and false if a
* value was not specified.
*/
public final boolean hasListOfEnums() {
return listOfEnums != null && !(listOfEnums instanceof SdkAutoConstructList);
}
/**
* Returns the value of the ListOfEnums property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasListOfEnums} method.
* </p>
*
* @return The value of the ListOfEnums property for this object.
*/
public final List<String> listOfEnumsAsStrings() {
return listOfEnums;
}
/**
* For responses, this returns true if the service returned a value for the ListOfMaps property. This DOES NOT check
* that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is
* useful because the SDK will never return a null collection or map, but you may need to differentiate between the
* service returning nothing (or null) and the service returning an empty collection or map. For requests, this
* returns true if a value for the property was specified in the request builder, and false if a value was not
* specified.
*/
public final boolean hasListOfMaps() {
return listOfMaps != null && !(listOfMaps instanceof SdkAutoConstructList);
}
/**
* Returns the value of the ListOfMaps property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasListOfMaps} method.
* </p>
*
* @return The value of the ListOfMaps property for this object.
*/
public final List<Map<String, String>> listOfMaps() {
return listOfMaps;
}
/**
* For responses, this returns true if the service returned a value for the ListOfStructs property. This DOES NOT
* check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property).
* This is useful because the SDK will never return a null collection or map, but you may need to differentiate
* between the service returning nothing (or null) and the service returning an empty collection or map. For
* requests, this returns true if a value for the property was specified in the request builder, and false if a
* value was not specified.
*/
public final boolean hasListOfStructs() {
return listOfStructs != null && !(listOfStructs instanceof SdkAutoConstructList);
}
/**
* Returns the value of the ListOfStructs property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasListOfStructs} method.
* </p>
*
* @return The value of the ListOfStructs property for this object.
*/
public final List<SimpleStruct> listOfStructs() {
return listOfStructs;
}
/**
* Returns the value of the ListOfMapOfEnumToString property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasListOfMapOfEnumToString} method.
* </p>
*
* @return The value of the ListOfMapOfEnumToString property for this object.
*/
public final List<Map<EnumType, String>> listOfMapOfEnumToString() {
return ListOfMapOfEnumToStringCopier.copyStringToEnum(listOfMapOfEnumToString);
}
/**
* For responses, this returns true if the service returned a value for the ListOfMapOfEnumToString property. This
* DOES NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the
* property). This is useful because the SDK will never return a null collection or map, but you may need to
* differentiate between the service returning nothing (or null) and the service returning an empty collection or
* map. For requests, this returns true if a value for the property was specified in the request builder, and false
* if a value was not specified.
*/
public final boolean hasListOfMapOfEnumToString() {
return listOfMapOfEnumToString != null && !(listOfMapOfEnumToString instanceof SdkAutoConstructList);
}
/**
* Returns the value of the ListOfMapOfEnumToString property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasListOfMapOfEnumToString} method.
* </p>
*
* @return The value of the ListOfMapOfEnumToString property for this object.
*/
public final List<Map<String, String>> listOfMapOfEnumToStringAsStrings() {
return listOfMapOfEnumToString;
}
/**
* For responses, this returns true if the service returned a value for the ListOfMapOfStringToStruct property. This
* DOES NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the
* property). This is useful because the SDK will never return a null collection or map, but you may need to
* differentiate between the service returning nothing (or null) and the service returning an empty collection or
* map. For requests, this returns true if a value for the property was specified in the request builder, and false
* if a value was not specified.
*/
public final boolean hasListOfMapOfStringToStruct() {
return listOfMapOfStringToStruct != null && !(listOfMapOfStringToStruct instanceof SdkAutoConstructList);
}
/**
* Returns the value of the ListOfMapOfStringToStruct property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasListOfMapOfStringToStruct} method.
* </p>
*
* @return The value of the ListOfMapOfStringToStruct property for this object.
*/
public final List<Map<String, SimpleStruct>> listOfMapOfStringToStruct() {
return listOfMapOfStringToStruct;
}
/**
* For responses, this returns true if the service returned a value for the MapOfStringToIntegerList property. This
* DOES NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the
* property). This is useful because the SDK will never return a null collection or map, but you may need to
* differentiate between the service returning nothing (or null) and the service returning an empty collection or
* map. For requests, this returns true if a value for the property was specified in the request builder, and false
* if a value was not specified.
*/
public final boolean hasMapOfStringToIntegerList() {
return mapOfStringToIntegerList != null && !(mapOfStringToIntegerList instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the MapOfStringToIntegerList property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasMapOfStringToIntegerList} method.
* </p>
*
* @return The value of the MapOfStringToIntegerList property for this object.
*/
public final Map<String, List<Integer>> mapOfStringToIntegerList() {
return mapOfStringToIntegerList;
}
/**
* For responses, this returns true if the service returned a value for the MapOfStringToString property. This DOES
* NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property).
* This is useful because the SDK will never return a null collection or map, but you may need to differentiate
* between the service returning nothing (or null) and the service returning an empty collection or map. For
* requests, this returns true if a value for the property was specified in the request builder, and false if a
* value was not specified.
*/
public final boolean hasMapOfStringToString() {
return mapOfStringToString != null && !(mapOfStringToString instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the MapOfStringToString property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasMapOfStringToString} method.
* </p>
*
* @return The value of the MapOfStringToString property for this object.
*/
public final Map<String, String> mapOfStringToString() {
return mapOfStringToString;
}
/**
* For responses, this returns true if the service returned a value for the MapOfStringToSimpleStruct property. This
* DOES NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the
* property). This is useful because the SDK will never return a null collection or map, but you may need to
* differentiate between the service returning nothing (or null) and the service returning an empty collection or
* map. For requests, this returns true if a value for the property was specified in the request builder, and false
* if a value was not specified.
*/
public final boolean hasMapOfStringToSimpleStruct() {
return mapOfStringToSimpleStruct != null && !(mapOfStringToSimpleStruct instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the MapOfStringToSimpleStruct property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasMapOfStringToSimpleStruct} method.
* </p>
*
* @return The value of the MapOfStringToSimpleStruct property for this object.
*/
public final Map<String, SimpleStruct> mapOfStringToSimpleStruct() {
return mapOfStringToSimpleStruct;
}
/**
* Returns the value of the MapOfEnumToEnum property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasMapOfEnumToEnum} method.
* </p>
*
* @return The value of the MapOfEnumToEnum property for this object.
*/
public final Map<EnumType, EnumType> mapOfEnumToEnum() {
return MapOfEnumToEnumCopier.copyStringToEnum(mapOfEnumToEnum);
}
/**
* For responses, this returns true if the service returned a value for the MapOfEnumToEnum property. This DOES NOT
* check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property).
* This is useful because the SDK will never return a null collection or map, but you may need to differentiate
* between the service returning nothing (or null) and the service returning an empty collection or map. For
* requests, this returns true if a value for the property was specified in the request builder, and false if a
* value was not specified.
*/
public final boolean hasMapOfEnumToEnum() {
return mapOfEnumToEnum != null && !(mapOfEnumToEnum instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the MapOfEnumToEnum property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasMapOfEnumToEnum} method.
* </p>
*
* @return The value of the MapOfEnumToEnum property for this object.
*/
public final Map<String, String> mapOfEnumToEnumAsStrings() {
return mapOfEnumToEnum;
}
/**
* Returns the value of the MapOfEnumToString property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasMapOfEnumToString} method.
* </p>
*
* @return The value of the MapOfEnumToString property for this object.
*/
public final Map<EnumType, String> mapOfEnumToString() {
return MapOfEnumToStringCopier.copyStringToEnum(mapOfEnumToString);
}
/**
* For responses, this returns true if the service returned a value for the MapOfEnumToString property. This DOES
* NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property).
* This is useful because the SDK will never return a null collection or map, but you may need to differentiate
* between the service returning nothing (or null) and the service returning an empty collection or map. For
* requests, this returns true if a value for the property was specified in the request builder, and false if a
* value was not specified.
*/
public final boolean hasMapOfEnumToString() {
return mapOfEnumToString != null && !(mapOfEnumToString instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the MapOfEnumToString property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasMapOfEnumToString} method.
* </p>
*
* @return The value of the MapOfEnumToString property for this object.
*/
public final Map<String, String> mapOfEnumToStringAsStrings() {
return mapOfEnumToString;
}
/**
* Returns the value of the MapOfStringToEnum property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasMapOfStringToEnum} method.
* </p>
*
* @return The value of the MapOfStringToEnum property for this object.
*/
public final Map<String, EnumType> mapOfStringToEnum() {
return MapOfStringToEnumCopier.copyStringToEnum(mapOfStringToEnum);
}
/**
* For responses, this returns true if the service returned a value for the MapOfStringToEnum property. This DOES
* NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property).
* This is useful because the SDK will never return a null collection or map, but you may need to differentiate
* between the service returning nothing (or null) and the service returning an empty collection or map. For
* requests, this returns true if a value for the property was specified in the request builder, and false if a
* value was not specified.
*/
public final boolean hasMapOfStringToEnum() {
return mapOfStringToEnum != null && !(mapOfStringToEnum instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the MapOfStringToEnum property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasMapOfStringToEnum} method.
* </p>
*
* @return The value of the MapOfStringToEnum property for this object.
*/
public final Map<String, String> mapOfStringToEnumAsStrings() {
return mapOfStringToEnum;
}
/**
* Returns the value of the MapOfEnumToSimpleStruct property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasMapOfEnumToSimpleStruct} method.
* </p>
*
* @return The value of the MapOfEnumToSimpleStruct property for this object.
*/
public final Map<EnumType, SimpleStruct> mapOfEnumToSimpleStruct() {
return MapOfEnumToSimpleStructCopier.copyStringToEnum(mapOfEnumToSimpleStruct);
}
/**
* For responses, this returns true if the service returned a value for the MapOfEnumToSimpleStruct property. This
* DOES NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the
* property). This is useful because the SDK will never return a null collection or map, but you may need to
* differentiate between the service returning nothing (or null) and the service returning an empty collection or
* map. For requests, this returns true if a value for the property was specified in the request builder, and false
* if a value was not specified.
*/
public final boolean hasMapOfEnumToSimpleStruct() {
return mapOfEnumToSimpleStruct != null && !(mapOfEnumToSimpleStruct instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the MapOfEnumToSimpleStruct property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasMapOfEnumToSimpleStruct} method.
* </p>
*
* @return The value of the MapOfEnumToSimpleStruct property for this object.
*/
public final Map<String, SimpleStruct> mapOfEnumToSimpleStructAsStrings() {
return mapOfEnumToSimpleStruct;
}
/**
* Returns the value of the MapOfEnumToListOfEnums property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasMapOfEnumToListOfEnums} method.
* </p>
*
* @return The value of the MapOfEnumToListOfEnums property for this object.
*/
public final Map<EnumType, List<EnumType>> mapOfEnumToListOfEnums() {
return MapOfEnumToListOfEnumsCopier.copyStringToEnum(mapOfEnumToListOfEnums);
}
/**
* For responses, this returns true if the service returned a value for the MapOfEnumToListOfEnums property. This
* DOES NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the
* property). This is useful because the SDK will never return a null collection or map, but you may need to
* differentiate between the service returning nothing (or null) and the service returning an empty collection or
* map. For requests, this returns true if a value for the property was specified in the request builder, and false
* if a value was not specified.
*/
public final boolean hasMapOfEnumToListOfEnums() {
return mapOfEnumToListOfEnums != null && !(mapOfEnumToListOfEnums instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the MapOfEnumToListOfEnums property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasMapOfEnumToListOfEnums} method.
* </p>
*
* @return The value of the MapOfEnumToListOfEnums property for this object.
*/
public final Map<String, List<String>> mapOfEnumToListOfEnumsAsStrings() {
return mapOfEnumToListOfEnums;
}
/**
* Returns the value of the MapOfEnumToMapOfStringToEnum property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasMapOfEnumToMapOfStringToEnum} method.
* </p>
*
* @return The value of the MapOfEnumToMapOfStringToEnum property for this object.
*/
public final Map<EnumType, Map<String, EnumType>> mapOfEnumToMapOfStringToEnum() {
return MapOfEnumToMapOfStringToEnumCopier.copyStringToEnum(mapOfEnumToMapOfStringToEnum);
}
/**
* For responses, this returns true if the service returned a value for the MapOfEnumToMapOfStringToEnum property.
* This DOES NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the
* property). This is useful because the SDK will never return a null collection or map, but you may need to
* differentiate between the service returning nothing (or null) and the service returning an empty collection or
* map. For requests, this returns true if a value for the property was specified in the request builder, and false
* if a value was not specified.
*/
public final boolean hasMapOfEnumToMapOfStringToEnum() {
return mapOfEnumToMapOfStringToEnum != null && !(mapOfEnumToMapOfStringToEnum instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the MapOfEnumToMapOfStringToEnum property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasMapOfEnumToMapOfStringToEnum} method.
* </p>
*
* @return The value of the MapOfEnumToMapOfStringToEnum property for this object.
*/
public final Map<String, Map<String, String>> mapOfEnumToMapOfStringToEnumAsStrings() {
return mapOfEnumToMapOfStringToEnum;
}
/**
* Returns the value of the TimestampMember property for this object.
*
* @return The value of the TimestampMember property for this object.
*/
public final Instant timestampMember() {
return timestampMember;
}
/**
* Returns the value of the StructWithNestedTimestampMember property for this object.
*
* @return The value of the StructWithNestedTimestampMember property for this object.
*/
public final StructWithTimestamp structWithNestedTimestampMember() {
return structWithNestedTimestampMember;
}
/**
* Returns the value of the BlobArg property for this object.
*
* @return The value of the BlobArg property for this object.
*/
public final SdkBytes blobArg() {
return blobArg;
}
/**
* Returns the value of the StructWithNestedBlob property for this object.
*
* @return The value of the StructWithNestedBlob property for this object.
*/
public final StructWithNestedBlobType structWithNestedBlob() {
return structWithNestedBlob;
}
/**
* For responses, this returns true if the service returned a value for the BlobMap property. This DOES NOT check
* that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is
* useful because the SDK will never return a null collection or map, but you may need to differentiate between the
* service returning nothing (or null) and the service returning an empty collection or map. For requests, this
* returns true if a value for the property was specified in the request builder, and false if a value was not
* specified.
*/
public final boolean hasBlobMap() {
return blobMap != null && !(blobMap instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the BlobMap property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasBlobMap} method.
* </p>
*
* @return The value of the BlobMap property for this object.
*/
public final Map<String, SdkBytes> blobMap() {
return blobMap;
}
/**
* For responses, this returns true if the service returned a value for the ListOfBlobs property. This DOES NOT
* check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property).
* This is useful because the SDK will never return a null collection or map, but you may need to differentiate
* between the service returning nothing (or null) and the service returning an empty collection or map. For
* requests, this returns true if a value for the property was specified in the request builder, and false if a
* value was not specified.
*/
public final boolean hasListOfBlobs() {
return listOfBlobs != null && !(listOfBlobs instanceof SdkAutoConstructList);
}
/**
* Returns the value of the ListOfBlobs property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasListOfBlobs} method.
* </p>
*
* @return The value of the ListOfBlobs property for this object.
*/
public final List<SdkBytes> listOfBlobs() {
return listOfBlobs;
}
/**
* Returns the value of the RecursiveStruct property for this object.
*
* @return The value of the RecursiveStruct property for this object.
*/
public final RecursiveStructType recursiveStruct() {
return recursiveStruct;
}
/**
* Returns the value of the PolymorphicTypeWithSubTypes property for this object.
*
* @return The value of the PolymorphicTypeWithSubTypes property for this object.
*/
public final BaseType polymorphicTypeWithSubTypes() {
return polymorphicTypeWithSubTypes;
}
/**
* Returns the value of the PolymorphicTypeWithoutSubTypes property for this object.
*
* @return The value of the PolymorphicTypeWithoutSubTypes property for this object.
*/
public final SubTypeOne polymorphicTypeWithoutSubTypes() {
return polymorphicTypeWithoutSubTypes;
}
/**
* Returns the value of the EnumType property for this object.
* <p>
* If the service returns an enum value that is not available in the current SDK version, {@link #enumType} will
* return {@link EnumType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #enumTypeAsString}.
* </p>
*
* @return The value of the EnumType property for this object.
* @see EnumType
*/
public final EnumType enumType() {
return EnumType.fromValue(enumType);
}
/**
* Returns the value of the EnumType property for this object.
* <p>
* If the service returns an enum value that is not available in the current SDK version, {@link #enumType} will
* return {@link EnumType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #enumTypeAsString}.
* </p>
*
* @return The value of the EnumType property for this object.
* @see EnumType
*/
public final String enumTypeAsString() {
return enumType;
}
/**
* Returns the value of the Underscore_Name_Type property for this object.
*
* @return The value of the Underscore_Name_Type property for this object.
*/
public final Underscore_Name_Type underscore_Name_Type() {
return underscore_Name_Type;
}
/**
* Returns the value of the MyDocument property for this object.
*
* @return The value of the MyDocument property for this object.
*/
public final Document myDocument() {
return myDocument;
}
/**
* Returns the value of the AllTypesUnionStructure property for this object.
*
* @return The value of the AllTypesUnionStructure property for this object.
*/
public final AllTypesUnionStructure allTypesUnionStructure() {
return allTypesUnionStructure;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class<? extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
hashCode = 31 * hashCode + Objects.hashCode(stringMember());
hashCode = 31 * hashCode + Objects.hashCode(integerMember());
hashCode = 31 * hashCode + Objects.hashCode(booleanMember());
hashCode = 31 * hashCode + Objects.hashCode(floatMember());
hashCode = 31 * hashCode + Objects.hashCode(doubleMember());
hashCode = 31 * hashCode + Objects.hashCode(longMember());
hashCode = 31 * hashCode + Objects.hashCode(shortMember());
hashCode = 31 * hashCode + Objects.hashCode(hasSimpleList() ? simpleList() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasListOfEnums() ? listOfEnumsAsStrings() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasListOfMaps() ? listOfMaps() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasListOfStructs() ? listOfStructs() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasListOfMapOfEnumToString() ? listOfMapOfEnumToStringAsStrings() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasListOfMapOfStringToStruct() ? listOfMapOfStringToStruct() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasMapOfStringToIntegerList() ? mapOfStringToIntegerList() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasMapOfStringToString() ? mapOfStringToString() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasMapOfStringToSimpleStruct() ? mapOfStringToSimpleStruct() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasMapOfEnumToEnum() ? mapOfEnumToEnumAsStrings() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasMapOfEnumToString() ? mapOfEnumToStringAsStrings() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasMapOfStringToEnum() ? mapOfStringToEnumAsStrings() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasMapOfEnumToSimpleStruct() ? mapOfEnumToSimpleStructAsStrings() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasMapOfEnumToListOfEnums() ? mapOfEnumToListOfEnumsAsStrings() : null);
hashCode = 31 * hashCode
+ Objects.hashCode(hasMapOfEnumToMapOfStringToEnum() ? mapOfEnumToMapOfStringToEnumAsStrings() : null);
hashCode = 31 * hashCode + Objects.hashCode(timestampMember());
hashCode = 31 * hashCode + Objects.hashCode(structWithNestedTimestampMember());
hashCode = 31 * hashCode + Objects.hashCode(blobArg());
hashCode = 31 * hashCode + Objects.hashCode(structWithNestedBlob());
hashCode = 31 * hashCode + Objects.hashCode(hasBlobMap() ? blobMap() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasListOfBlobs() ? listOfBlobs() : null);
hashCode = 31 * hashCode + Objects.hashCode(recursiveStruct());
hashCode = 31 * hashCode + Objects.hashCode(polymorphicTypeWithSubTypes());
hashCode = 31 * hashCode + Objects.hashCode(polymorphicTypeWithoutSubTypes());
hashCode = 31 * hashCode + Objects.hashCode(enumTypeAsString());
hashCode = 31 * hashCode + Objects.hashCode(underscore_Name_Type());
hashCode = 31 * hashCode + Objects.hashCode(myDocument());
hashCode = 31 * hashCode + Objects.hashCode(allTypesUnionStructure());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof AllTypesRequest)) {
return false;
}
AllTypesRequest other = (AllTypesRequest) obj;
return Objects.equals(stringMember(), other.stringMember()) && Objects.equals(integerMember(), other.integerMember())
&& Objects.equals(booleanMember(), other.booleanMember()) && Objects.equals(floatMember(), other.floatMember())
&& Objects.equals(doubleMember(), other.doubleMember()) && Objects.equals(longMember(), other.longMember())
&& Objects.equals(shortMember(), other.shortMember()) && hasSimpleList() == other.hasSimpleList()
&& Objects.equals(simpleList(), other.simpleList()) && hasListOfEnums() == other.hasListOfEnums()
&& Objects.equals(listOfEnumsAsStrings(), other.listOfEnumsAsStrings())
&& hasListOfMaps() == other.hasListOfMaps() && Objects.equals(listOfMaps(), other.listOfMaps())
&& hasListOfStructs() == other.hasListOfStructs() && Objects.equals(listOfStructs(), other.listOfStructs())
&& hasListOfMapOfEnumToString() == other.hasListOfMapOfEnumToString()
&& Objects.equals(listOfMapOfEnumToStringAsStrings(), other.listOfMapOfEnumToStringAsStrings())
&& hasListOfMapOfStringToStruct() == other.hasListOfMapOfStringToStruct()
&& Objects.equals(listOfMapOfStringToStruct(), other.listOfMapOfStringToStruct())
&& hasMapOfStringToIntegerList() == other.hasMapOfStringToIntegerList()
&& Objects.equals(mapOfStringToIntegerList(), other.mapOfStringToIntegerList())
&& hasMapOfStringToString() == other.hasMapOfStringToString()
&& Objects.equals(mapOfStringToString(), other.mapOfStringToString())
&& hasMapOfStringToSimpleStruct() == other.hasMapOfStringToSimpleStruct()
&& Objects.equals(mapOfStringToSimpleStruct(), other.mapOfStringToSimpleStruct())
&& hasMapOfEnumToEnum() == other.hasMapOfEnumToEnum()
&& Objects.equals(mapOfEnumToEnumAsStrings(), other.mapOfEnumToEnumAsStrings())
&& hasMapOfEnumToString() == other.hasMapOfEnumToString()
&& Objects.equals(mapOfEnumToStringAsStrings(), other.mapOfEnumToStringAsStrings())
&& hasMapOfStringToEnum() == other.hasMapOfStringToEnum()
&& Objects.equals(mapOfStringToEnumAsStrings(), other.mapOfStringToEnumAsStrings())
&& hasMapOfEnumToSimpleStruct() == other.hasMapOfEnumToSimpleStruct()
&& Objects.equals(mapOfEnumToSimpleStructAsStrings(), other.mapOfEnumToSimpleStructAsStrings())
&& hasMapOfEnumToListOfEnums() == other.hasMapOfEnumToListOfEnums()
&& Objects.equals(mapOfEnumToListOfEnumsAsStrings(), other.mapOfEnumToListOfEnumsAsStrings())
&& hasMapOfEnumToMapOfStringToEnum() == other.hasMapOfEnumToMapOfStringToEnum()
&& Objects.equals(mapOfEnumToMapOfStringToEnumAsStrings(), other.mapOfEnumToMapOfStringToEnumAsStrings())
&& Objects.equals(timestampMember(), other.timestampMember())
&& Objects.equals(structWithNestedTimestampMember(), other.structWithNestedTimestampMember())
&& Objects.equals(blobArg(), other.blobArg())
&& Objects.equals(structWithNestedBlob(), other.structWithNestedBlob()) && hasBlobMap() == other.hasBlobMap()
&& Objects.equals(blobMap(), other.blobMap()) && hasListOfBlobs() == other.hasListOfBlobs()
&& Objects.equals(listOfBlobs(), other.listOfBlobs())
&& Objects.equals(recursiveStruct(), other.recursiveStruct())
&& Objects.equals(polymorphicTypeWithSubTypes(), other.polymorphicTypeWithSubTypes())
&& Objects.equals(polymorphicTypeWithoutSubTypes(), other.polymorphicTypeWithoutSubTypes())
&& Objects.equals(enumTypeAsString(), other.enumTypeAsString())
&& Objects.equals(underscore_Name_Type(), other.underscore_Name_Type())
&& Objects.equals(myDocument(), other.myDocument())
&& Objects.equals(allTypesUnionStructure(), other.allTypesUnionStructure());
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString
.builder("AllTypesRequest")
.add("StringMember", stringMember())
.add("IntegerMember", integerMember())
.add("BooleanMember", booleanMember())
.add("FloatMember", floatMember())
.add("DoubleMember", doubleMember())
.add("LongMember", longMember())
.add("ShortMember", shortMember())
.add("SimpleList", hasSimpleList() ? simpleList() : null)
.add("ListOfEnums", hasListOfEnums() ? listOfEnumsAsStrings() : null)
.add("ListOfMaps", hasListOfMaps() ? listOfMaps() : null)
.add("ListOfStructs", hasListOfStructs() ? listOfStructs() : null)
.add("ListOfMapOfEnumToString", hasListOfMapOfEnumToString() ? listOfMapOfEnumToStringAsStrings() : null)
.add("ListOfMapOfStringToStruct", hasListOfMapOfStringToStruct() ? listOfMapOfStringToStruct() : null)
.add("MapOfStringToIntegerList", hasMapOfStringToIntegerList() ? mapOfStringToIntegerList() : null)
.add("MapOfStringToString", hasMapOfStringToString() ? mapOfStringToString() : null)
.add("MapOfStringToSimpleStruct", hasMapOfStringToSimpleStruct() ? mapOfStringToSimpleStruct() : null)
.add("MapOfEnumToEnum", hasMapOfEnumToEnum() ? mapOfEnumToEnumAsStrings() : null)
.add("MapOfEnumToString", hasMapOfEnumToString() ? mapOfEnumToStringAsStrings() : null)
.add("MapOfStringToEnum", hasMapOfStringToEnum() ? mapOfStringToEnumAsStrings() : null)
.add("MapOfEnumToSimpleStruct", hasMapOfEnumToSimpleStruct() ? mapOfEnumToSimpleStructAsStrings() : null)
.add("MapOfEnumToListOfEnums", hasMapOfEnumToListOfEnums() ? mapOfEnumToListOfEnumsAsStrings() : null)
.add("MapOfEnumToMapOfStringToEnum",
hasMapOfEnumToMapOfStringToEnum() ? mapOfEnumToMapOfStringToEnumAsStrings() : null)
.add("TimestampMember", timestampMember())
.add("StructWithNestedTimestampMember", structWithNestedTimestampMember()).add("BlobArg", blobArg())
.add("StructWithNestedBlob", structWithNestedBlob()).add("BlobMap", hasBlobMap() ? blobMap() : null)
.add("ListOfBlobs", hasListOfBlobs() ? listOfBlobs() : null).add("RecursiveStruct", recursiveStruct())
.add("PolymorphicTypeWithSubTypes", polymorphicTypeWithSubTypes())
.add("PolymorphicTypeWithoutSubTypes", polymorphicTypeWithoutSubTypes()).add("EnumType", enumTypeAsString())
.add("Underscore_Name_Type", underscore_Name_Type()).add("MyDocument", myDocument())
.add("AllTypesUnionStructure", allTypesUnionStructure()).build();
}
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
switch (fieldName) {
case "StringMember":
return Optional.ofNullable(clazz.cast(stringMember()));
case "IntegerMember":
return Optional.ofNullable(clazz.cast(integerMember()));
case "BooleanMember":
return Optional.ofNullable(clazz.cast(booleanMember()));
case "FloatMember":
return Optional.ofNullable(clazz.cast(floatMember()));
case "DoubleMember":
return Optional.ofNullable(clazz.cast(doubleMember()));
case "LongMember":
return Optional.ofNullable(clazz.cast(longMember()));
case "ShortMember":
return Optional.ofNullable(clazz.cast(shortMember()));
case "SimpleList":
return Optional.ofNullable(clazz.cast(simpleList()));
case "ListOfEnums":
return Optional.ofNullable(clazz.cast(listOfEnumsAsStrings()));
case "ListOfMaps":
return Optional.ofNullable(clazz.cast(listOfMaps()));
case "ListOfStructs":
return Optional.ofNullable(clazz.cast(listOfStructs()));
case "ListOfMapOfEnumToString":
return Optional.ofNullable(clazz.cast(listOfMapOfEnumToStringAsStrings()));
case "ListOfMapOfStringToStruct":
return Optional.ofNullable(clazz.cast(listOfMapOfStringToStruct()));
case "MapOfStringToIntegerList":
return Optional.ofNullable(clazz.cast(mapOfStringToIntegerList()));
case "MapOfStringToString":
return Optional.ofNullable(clazz.cast(mapOfStringToString()));
case "MapOfStringToSimpleStruct":
return Optional.ofNullable(clazz.cast(mapOfStringToSimpleStruct()));
case "MapOfEnumToEnum":
return Optional.ofNullable(clazz.cast(mapOfEnumToEnumAsStrings()));
case "MapOfEnumToString":
return Optional.ofNullable(clazz.cast(mapOfEnumToStringAsStrings()));
case "MapOfStringToEnum":
return Optional.ofNullable(clazz.cast(mapOfStringToEnumAsStrings()));
case "MapOfEnumToSimpleStruct":
return Optional.ofNullable(clazz.cast(mapOfEnumToSimpleStructAsStrings()));
case "MapOfEnumToListOfEnums":
return Optional.ofNullable(clazz.cast(mapOfEnumToListOfEnumsAsStrings()));
case "MapOfEnumToMapOfStringToEnum":
return Optional.ofNullable(clazz.cast(mapOfEnumToMapOfStringToEnumAsStrings()));
case "TimestampMember":
return Optional.ofNullable(clazz.cast(timestampMember()));
case "StructWithNestedTimestampMember":
return Optional.ofNullable(clazz.cast(structWithNestedTimestampMember()));
case "BlobArg":
return Optional.ofNullable(clazz.cast(blobArg()));
case "StructWithNestedBlob":
return Optional.ofNullable(clazz.cast(structWithNestedBlob()));
case "BlobMap":
return Optional.ofNullable(clazz.cast(blobMap()));
case "ListOfBlobs":
return Optional.ofNullable(clazz.cast(listOfBlobs()));
case "RecursiveStruct":
return Optional.ofNullable(clazz.cast(recursiveStruct()));
case "PolymorphicTypeWithSubTypes":
return Optional.ofNullable(clazz.cast(polymorphicTypeWithSubTypes()));
case "PolymorphicTypeWithoutSubTypes":
return Optional.ofNullable(clazz.cast(polymorphicTypeWithoutSubTypes()));
case "EnumType":
return Optional.ofNullable(clazz.cast(enumTypeAsString()));
case "Underscore_Name_Type":
return Optional.ofNullable(clazz.cast(underscore_Name_Type()));
case "MyDocument":
return Optional.ofNullable(clazz.cast(myDocument()));
case "AllTypesUnionStructure":
return Optional.ofNullable(clazz.cast(allTypesUnionStructure()));
default:
return Optional.empty();
}
}
@Override
public final List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
private static <T> Function<Object, T> getter(Function<AllTypesRequest, T> g) {
return obj -> g.apply((AllTypesRequest) obj);
}
private static <T> BiConsumer<Object, T> setter(BiConsumer<Builder, T> s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
public interface Builder extends JsonProtocolTestsRequest.Builder, SdkPojo, CopyableBuilder<Builder, AllTypesRequest> {
/**
* Sets the value of the StringMember property for this object.
*
* @param stringMember
* The new value for the StringMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder stringMember(String stringMember);
/**
* Sets the value of the IntegerMember property for this object.
*
* @param integerMember
* The new value for the IntegerMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder integerMember(Integer integerMember);
/**
* Sets the value of the BooleanMember property for this object.
*
* @param booleanMember
* The new value for the BooleanMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder booleanMember(Boolean booleanMember);
/**
* Sets the value of the FloatMember property for this object.
*
* @param floatMember
* The new value for the FloatMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder floatMember(Float floatMember);
/**
* Sets the value of the DoubleMember property for this object.
*
* @param doubleMember
* The new value for the DoubleMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder doubleMember(Double doubleMember);
/**
* Sets the value of the LongMember property for this object.
*
* @param longMember
* The new value for the LongMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder longMember(Long longMember);
/**
* Sets the value of the ShortMember property for this object.
*
* @param shortMember
* The new value for the ShortMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder shortMember(Short shortMember);
/**
* Sets the value of the SimpleList property for this object.
*
* @param simpleList
* The new value for the SimpleList property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder simpleList(Collection<String> simpleList);
/**
* Sets the value of the SimpleList property for this object.
*
* @param simpleList
* The new value for the SimpleList property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder simpleList(String... simpleList);
/**
* Sets the value of the ListOfEnums property for this object.
*
* @param listOfEnums
* The new value for the ListOfEnums property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfEnumsWithStrings(Collection<String> listOfEnums);
/**
* Sets the value of the ListOfEnums property for this object.
*
* @param listOfEnums
* The new value for the ListOfEnums property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfEnumsWithStrings(String... listOfEnums);
/**
* Sets the value of the ListOfEnums property for this object.
*
* @param listOfEnums
* The new value for the ListOfEnums property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfEnums(Collection<EnumType> listOfEnums);
/**
* Sets the value of the ListOfEnums property for this object.
*
* @param listOfEnums
* The new value for the ListOfEnums property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfEnums(EnumType... listOfEnums);
/**
* Sets the value of the ListOfMaps property for this object.
*
* @param listOfMaps
* The new value for the ListOfMaps property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfMaps(Collection<? extends Map<String, String>> listOfMaps);
/**
* Sets the value of the ListOfMaps property for this object.
*
* @param listOfMaps
* The new value for the ListOfMaps property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfMaps(Map<String, String>... listOfMaps);
/**
* Sets the value of the ListOfStructs property for this object.
*
* @param listOfStructs
* The new value for the ListOfStructs property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfStructs(Collection<SimpleStruct> listOfStructs);
/**
* Sets the value of the ListOfStructs property for this object.
*
* @param listOfStructs
* The new value for the ListOfStructs property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfStructs(SimpleStruct... listOfStructs);
/**
* Sets the value of the ListOfStructs property for this object.
*
* This is a convenience method that creates an instance of the
* {@link software.amazon.awssdk.services.jsonprotocoltests.model.SimpleStruct.Builder} avoiding the need to
* create one manually via
* {@link software.amazon.awssdk.services.jsonprotocoltests.model.SimpleStruct#builder()}.
*
* <p>
* When the {@link Consumer} completes,
* {@link software.amazon.awssdk.services.jsonprotocoltests.model.SimpleStruct.Builder#build()} is called
* immediately and its result is passed to {@link #listOfStructs(List<SimpleStruct>)}.
*
* @param listOfStructs
* a consumer that will call methods on
* {@link software.amazon.awssdk.services.jsonprotocoltests.model.SimpleStruct.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #listOfStructs(java.util.Collection<SimpleStruct>)
*/
Builder listOfStructs(Consumer<SimpleStruct.Builder>... listOfStructs);
/**
* Sets the value of the ListOfMapOfEnumToString property for this object.
*
* @param listOfMapOfEnumToString
* The new value for the ListOfMapOfEnumToString property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfMapOfEnumToStringWithStrings(Collection<? extends Map<String, String>> listOfMapOfEnumToString);
/**
* Sets the value of the ListOfMapOfEnumToString property for this object.
*
* @param listOfMapOfEnumToString
* The new value for the ListOfMapOfEnumToString property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfMapOfEnumToStringWithStrings(Map<String, String>... listOfMapOfEnumToString);
/**
* Sets the value of the ListOfMapOfStringToStruct property for this object.
*
* @param listOfMapOfStringToStruct
* The new value for the ListOfMapOfStringToStruct property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfMapOfStringToStruct(Collection<? extends Map<String, SimpleStruct>> listOfMapOfStringToStruct);
/**
* Sets the value of the ListOfMapOfStringToStruct property for this object.
*
* @param listOfMapOfStringToStruct
* The new value for the ListOfMapOfStringToStruct property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfMapOfStringToStruct(Map<String, SimpleStruct>... listOfMapOfStringToStruct);
/**
* Sets the value of the MapOfStringToIntegerList property for this object.
*
* @param mapOfStringToIntegerList
* The new value for the MapOfStringToIntegerList property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfStringToIntegerList(Map<String, ? extends Collection<Integer>> mapOfStringToIntegerList);
/**
* Sets the value of the MapOfStringToString property for this object.
*
* @param mapOfStringToString
* The new value for the MapOfStringToString property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfStringToString(Map<String, String> mapOfStringToString);
/**
* Sets the value of the MapOfStringToSimpleStruct property for this object.
*
* @param mapOfStringToSimpleStruct
* The new value for the MapOfStringToSimpleStruct property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfStringToSimpleStruct(Map<String, SimpleStruct> mapOfStringToSimpleStruct);
/**
* Sets the value of the MapOfEnumToEnum property for this object.
*
* @param mapOfEnumToEnum
* The new value for the MapOfEnumToEnum property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfEnumToEnumWithStrings(Map<String, String> mapOfEnumToEnum);
/**
* Sets the value of the MapOfEnumToEnum property for this object.
*
* @param mapOfEnumToEnum
* The new value for the MapOfEnumToEnum property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfEnumToEnum(Map<EnumType, EnumType> mapOfEnumToEnum);
/**
* Sets the value of the MapOfEnumToString property for this object.
*
* @param mapOfEnumToString
* The new value for the MapOfEnumToString property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfEnumToStringWithStrings(Map<String, String> mapOfEnumToString);
/**
* Sets the value of the MapOfEnumToString property for this object.
*
* @param mapOfEnumToString
* The new value for the MapOfEnumToString property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfEnumToString(Map<EnumType, String> mapOfEnumToString);
/**
* Sets the value of the MapOfStringToEnum property for this object.
*
* @param mapOfStringToEnum
* The new value for the MapOfStringToEnum property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfStringToEnumWithStrings(Map<String, String> mapOfStringToEnum);
/**
* Sets the value of the MapOfStringToEnum property for this object.
*
* @param mapOfStringToEnum
* The new value for the MapOfStringToEnum property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfStringToEnum(Map<String, EnumType> mapOfStringToEnum);
/**
* Sets the value of the MapOfEnumToSimpleStruct property for this object.
*
* @param mapOfEnumToSimpleStruct
* The new value for the MapOfEnumToSimpleStruct property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfEnumToSimpleStructWithStrings(Map<String, SimpleStruct> mapOfEnumToSimpleStruct);
/**
* Sets the value of the MapOfEnumToSimpleStruct property for this object.
*
* @param mapOfEnumToSimpleStruct
* The new value for the MapOfEnumToSimpleStruct property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfEnumToSimpleStruct(Map<EnumType, SimpleStruct> mapOfEnumToSimpleStruct);
/**
* Sets the value of the MapOfEnumToListOfEnums property for this object.
*
* @param mapOfEnumToListOfEnums
* The new value for the MapOfEnumToListOfEnums property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfEnumToListOfEnumsWithStrings(Map<String, ? extends Collection<String>> mapOfEnumToListOfEnums);
/**
* Sets the value of the MapOfEnumToListOfEnums property for this object.
*
* @param mapOfEnumToListOfEnums
* The new value for the MapOfEnumToListOfEnums property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfEnumToListOfEnums(Map<EnumType, ? extends Collection<EnumType>> mapOfEnumToListOfEnums);
/**
* Sets the value of the MapOfEnumToMapOfStringToEnum property for this object.
*
* @param mapOfEnumToMapOfStringToEnum
* The new value for the MapOfEnumToMapOfStringToEnum property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfEnumToMapOfStringToEnumWithStrings(Map<String, ? extends Map<String, String>> mapOfEnumToMapOfStringToEnum);
/**
* Sets the value of the MapOfEnumToMapOfStringToEnum property for this object.
*
* @param mapOfEnumToMapOfStringToEnum
* The new value for the MapOfEnumToMapOfStringToEnum property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfEnumToMapOfStringToEnum(Map<EnumType, ? extends Map<String, EnumType>> mapOfEnumToMapOfStringToEnum);
/**
* Sets the value of the TimestampMember property for this object.
*
* @param timestampMember
* The new value for the TimestampMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder timestampMember(Instant timestampMember);
/**
* Sets the value of the StructWithNestedTimestampMember property for this object.
*
* @param structWithNestedTimestampMember
* The new value for the StructWithNestedTimestampMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder structWithNestedTimestampMember(StructWithTimestamp structWithNestedTimestampMember);
/**
* Sets the value of the StructWithNestedTimestampMember property for this object.
*
* This is a convenience method that creates an instance of the {@link StructWithTimestamp.Builder} avoiding the
* need to create one manually via {@link StructWithTimestamp#builder()}.
*
* <p>
* When the {@link Consumer} completes, {@link StructWithTimestamp.Builder#build()} is called immediately and
* its result is passed to {@link #structWithNestedTimestampMember(StructWithTimestamp)}.
*
* @param structWithNestedTimestampMember
* a consumer that will call methods on {@link StructWithTimestamp.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #structWithNestedTimestampMember(StructWithTimestamp)
*/
default Builder structWithNestedTimestampMember(Consumer<StructWithTimestamp.Builder> structWithNestedTimestampMember) {
return structWithNestedTimestampMember(StructWithTimestamp.builder().applyMutation(structWithNestedTimestampMember)
.build());
}
/**
* Sets the value of the BlobArg property for this object.
*
* @param blobArg
* The new value for the BlobArg property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder blobArg(SdkBytes blobArg);
/**
* Sets the value of the StructWithNestedBlob property for this object.
*
* @param structWithNestedBlob
* The new value for the StructWithNestedBlob property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder structWithNestedBlob(StructWithNestedBlobType structWithNestedBlob);
/**
* Sets the value of the StructWithNestedBlob property for this object.
*
* This is a convenience method that creates an instance of the {@link StructWithNestedBlobType.Builder}
* avoiding the need to create one manually via {@link StructWithNestedBlobType#builder()}.
*
* <p>
* When the {@link Consumer} completes, {@link StructWithNestedBlobType.Builder#build()} is called immediately
* and its result is passed to {@link #structWithNestedBlob(StructWithNestedBlobType)}.
*
* @param structWithNestedBlob
* a consumer that will call methods on {@link StructWithNestedBlobType.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #structWithNestedBlob(StructWithNestedBlobType)
*/
default Builder structWithNestedBlob(Consumer<StructWithNestedBlobType.Builder> structWithNestedBlob) {
return structWithNestedBlob(StructWithNestedBlobType.builder().applyMutation(structWithNestedBlob).build());
}
/**
* Sets the value of the BlobMap property for this object.
*
* @param blobMap
* The new value for the BlobMap property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder blobMap(Map<String, SdkBytes> blobMap);
/**
* Sets the value of the ListOfBlobs property for this object.
*
* @param listOfBlobs
* The new value for the ListOfBlobs property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfBlobs(Collection<SdkBytes> listOfBlobs);
/**
* Sets the value of the ListOfBlobs property for this object.
*
* @param listOfBlobs
* The new value for the ListOfBlobs property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfBlobs(SdkBytes... listOfBlobs);
/**
* Sets the value of the RecursiveStruct property for this object.
*
* @param recursiveStruct
* The new value for the RecursiveStruct property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder recursiveStruct(RecursiveStructType recursiveStruct);
/**
* Sets the value of the RecursiveStruct property for this object.
*
* This is a convenience method that creates an instance of the {@link RecursiveStructType.Builder} avoiding the
* need to create one manually via {@link RecursiveStructType#builder()}.
*
* <p>
* When the {@link Consumer} completes, {@link RecursiveStructType.Builder#build()} is called immediately and
* its result is passed to {@link #recursiveStruct(RecursiveStructType)}.
*
* @param recursiveStruct
* a consumer that will call methods on {@link RecursiveStructType.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #recursiveStruct(RecursiveStructType)
*/
default Builder recursiveStruct(Consumer<RecursiveStructType.Builder> recursiveStruct) {
return recursiveStruct(RecursiveStructType.builder().applyMutation(recursiveStruct).build());
}
/**
* Sets the value of the PolymorphicTypeWithSubTypes property for this object.
*
* @param polymorphicTypeWithSubTypes
* The new value for the PolymorphicTypeWithSubTypes property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder polymorphicTypeWithSubTypes(BaseType polymorphicTypeWithSubTypes);
/**
* Sets the value of the PolymorphicTypeWithSubTypes property for this object.
*
* This is a convenience method that creates an instance of the {@link BaseType.Builder} avoiding the need to
* create one manually via {@link BaseType#builder()}.
*
* <p>
* When the {@link Consumer} completes, {@link BaseType.Builder#build()} is called immediately and its result is
* passed to {@link #polymorphicTypeWithSubTypes(BaseType)}.
*
* @param polymorphicTypeWithSubTypes
* a consumer that will call methods on {@link BaseType.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #polymorphicTypeWithSubTypes(BaseType)
*/
default Builder polymorphicTypeWithSubTypes(Consumer<BaseType.Builder> polymorphicTypeWithSubTypes) {
return polymorphicTypeWithSubTypes(BaseType.builder().applyMutation(polymorphicTypeWithSubTypes).build());
}
/**
* Sets the value of the PolymorphicTypeWithoutSubTypes property for this object.
*
* @param polymorphicTypeWithoutSubTypes
* The new value for the PolymorphicTypeWithoutSubTypes property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder polymorphicTypeWithoutSubTypes(SubTypeOne polymorphicTypeWithoutSubTypes);
/**
* Sets the value of the PolymorphicTypeWithoutSubTypes property for this object.
*
* This is a convenience method that creates an instance of the {@link SubTypeOne.Builder} avoiding the need to
* create one manually via {@link SubTypeOne#builder()}.
*
* <p>
* When the {@link Consumer} completes, {@link SubTypeOne.Builder#build()} is called immediately and its result
* is passed to {@link #polymorphicTypeWithoutSubTypes(SubTypeOne)}.
*
* @param polymorphicTypeWithoutSubTypes
* a consumer that will call methods on {@link SubTypeOne.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #polymorphicTypeWithoutSubTypes(SubTypeOne)
*/
default Builder polymorphicTypeWithoutSubTypes(Consumer<SubTypeOne.Builder> polymorphicTypeWithoutSubTypes) {
return polymorphicTypeWithoutSubTypes(SubTypeOne.builder().applyMutation(polymorphicTypeWithoutSubTypes).build());
}
/**
* Sets the value of the EnumType property for this object.
*
* @param enumType
* The new value for the EnumType property for this object.
* @see EnumType
* @return Returns a reference to this object so that method calls can be chained together.
* @see EnumType
*/
Builder enumType(String enumType);
/**
* Sets the value of the EnumType property for this object.
*
* @param enumType
* The new value for the EnumType property for this object.
* @see EnumType
* @return Returns a reference to this object so that method calls can be chained together.
* @see EnumType
*/
Builder enumType(EnumType enumType);
/**
* Sets the value of the Underscore_Name_Type property for this object.
*
* @param underscore_Name_Type
* The new value for the Underscore_Name_Type property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder underscore_Name_Type(Underscore_Name_Type underscore_Name_Type);
/**
* Sets the value of the Underscore_Name_Type property for this object.
*
* This is a convenience method that creates an instance of the {@link Underscore_Name_Type.Builder} avoiding
* the need to create one manually via {@link Underscore_Name_Type#builder()}.
*
* <p>
* When the {@link Consumer} completes, {@link Underscore_Name_Type.Builder#build()} is called immediately and
* its result is passed to {@link #underscore_Name_Type(Underscore_Name_Type)}.
*
* @param underscore_Name_Type
* a consumer that will call methods on {@link Underscore_Name_Type.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #underscore_Name_Type(Underscore_Name_Type)
*/
default Builder underscore_Name_Type(Consumer<Underscore_Name_Type.Builder> underscore_Name_Type) {
return underscore_Name_Type(Underscore_Name_Type.builder().applyMutation(underscore_Name_Type).build());
}
/**
* Sets the value of the MyDocument property for this object.
*
* @param myDocument
* The new value for the MyDocument property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder myDocument(Document myDocument);
/**
* Sets the value of the AllTypesUnionStructure property for this object.
*
* @param allTypesUnionStructure
* The new value for the AllTypesUnionStructure property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder allTypesUnionStructure(AllTypesUnionStructure allTypesUnionStructure);
/**
* Sets the value of the AllTypesUnionStructure property for this object.
*
* This is a convenience method that creates an instance of the {@link AllTypesUnionStructure.Builder} avoiding
* the need to create one manually via {@link AllTypesUnionStructure#builder()}.
*
* <p>
* When the {@link Consumer} completes, {@link AllTypesUnionStructure.Builder#build()} is called immediately and
* its result is passed to {@link #allTypesUnionStructure(AllTypesUnionStructure)}.
*
* @param allTypesUnionStructure
* a consumer that will call methods on {@link AllTypesUnionStructure.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #allTypesUnionStructure(AllTypesUnionStructure)
*/
default Builder allTypesUnionStructure(Consumer<AllTypesUnionStructure.Builder> allTypesUnionStructure) {
return allTypesUnionStructure(AllTypesUnionStructure.builder().applyMutation(allTypesUnionStructure).build());
}
@Override
Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration);
@Override
Builder overrideConfiguration(Consumer<AwsRequestOverrideConfiguration.Builder> builderConsumer);
}
static final class BuilderImpl extends JsonProtocolTestsRequest.BuilderImpl implements Builder {
private String stringMember;
private Integer integerMember;
private Boolean booleanMember;
private Float floatMember;
private Double doubleMember;
private Long longMember;
private Short shortMember;
private List<String> simpleList = DefaultSdkAutoConstructList.getInstance();
private List<String> listOfEnums = DefaultSdkAutoConstructList.getInstance();
private List<Map<String, String>> listOfMaps = DefaultSdkAutoConstructList.getInstance();
private List<SimpleStruct> listOfStructs = DefaultSdkAutoConstructList.getInstance();
private List<Map<String, String>> listOfMapOfEnumToString = DefaultSdkAutoConstructList.getInstance();
private List<Map<String, SimpleStruct>> listOfMapOfStringToStruct = DefaultSdkAutoConstructList.getInstance();
private Map<String, List<Integer>> mapOfStringToIntegerList = DefaultSdkAutoConstructMap.getInstance();
private Map<String, String> mapOfStringToString = DefaultSdkAutoConstructMap.getInstance();
private Map<String, SimpleStruct> mapOfStringToSimpleStruct = DefaultSdkAutoConstructMap.getInstance();
private Map<String, String> mapOfEnumToEnum = DefaultSdkAutoConstructMap.getInstance();
private Map<String, String> mapOfEnumToString = DefaultSdkAutoConstructMap.getInstance();
private Map<String, String> mapOfStringToEnum = DefaultSdkAutoConstructMap.getInstance();
private Map<String, SimpleStruct> mapOfEnumToSimpleStruct = DefaultSdkAutoConstructMap.getInstance();
private Map<String, List<String>> mapOfEnumToListOfEnums = DefaultSdkAutoConstructMap.getInstance();
private Map<String, Map<String, String>> mapOfEnumToMapOfStringToEnum = DefaultSdkAutoConstructMap.getInstance();
private Instant timestampMember;
private StructWithTimestamp structWithNestedTimestampMember;
private SdkBytes blobArg;
private StructWithNestedBlobType structWithNestedBlob;
private Map<String, SdkBytes> blobMap = DefaultSdkAutoConstructMap.getInstance();
private List<SdkBytes> listOfBlobs = DefaultSdkAutoConstructList.getInstance();
private RecursiveStructType recursiveStruct;
private BaseType polymorphicTypeWithSubTypes;
private SubTypeOne polymorphicTypeWithoutSubTypes;
private String enumType;
private Underscore_Name_Type underscore_Name_Type;
private Document myDocument;
private AllTypesUnionStructure allTypesUnionStructure;
private BuilderImpl() {
}
private BuilderImpl(AllTypesRequest model) {
super(model);
stringMember(model.stringMember);
integerMember(model.integerMember);
booleanMember(model.booleanMember);
floatMember(model.floatMember);
doubleMember(model.doubleMember);
longMember(model.longMember);
shortMember(model.shortMember);
simpleList(model.simpleList);
listOfEnumsWithStrings(model.listOfEnums);
listOfMaps(model.listOfMaps);
listOfStructs(model.listOfStructs);
listOfMapOfEnumToStringWithStrings(model.listOfMapOfEnumToString);
listOfMapOfStringToStruct(model.listOfMapOfStringToStruct);
mapOfStringToIntegerList(model.mapOfStringToIntegerList);
mapOfStringToString(model.mapOfStringToString);
mapOfStringToSimpleStruct(model.mapOfStringToSimpleStruct);
mapOfEnumToEnumWithStrings(model.mapOfEnumToEnum);
mapOfEnumToStringWithStrings(model.mapOfEnumToString);
mapOfStringToEnumWithStrings(model.mapOfStringToEnum);
mapOfEnumToSimpleStructWithStrings(model.mapOfEnumToSimpleStruct);
mapOfEnumToListOfEnumsWithStrings(model.mapOfEnumToListOfEnums);
mapOfEnumToMapOfStringToEnumWithStrings(model.mapOfEnumToMapOfStringToEnum);
timestampMember(model.timestampMember);
structWithNestedTimestampMember(model.structWithNestedTimestampMember);
blobArg(model.blobArg);
structWithNestedBlob(model.structWithNestedBlob);
blobMap(model.blobMap);
listOfBlobs(model.listOfBlobs);
recursiveStruct(model.recursiveStruct);
polymorphicTypeWithSubTypes(model.polymorphicTypeWithSubTypes);
polymorphicTypeWithoutSubTypes(model.polymorphicTypeWithoutSubTypes);
enumType(model.enumType);
underscore_Name_Type(model.underscore_Name_Type);
myDocument(model.myDocument);
allTypesUnionStructure(model.allTypesUnionStructure);
}
public final String getStringMember() {
return stringMember;
}
public final void setStringMember(String stringMember) {
this.stringMember = stringMember;
}
@Override
public final Builder stringMember(String stringMember) {
this.stringMember = stringMember;
return this;
}
public final Integer getIntegerMember() {
return integerMember;
}
public final void setIntegerMember(Integer integerMember) {
this.integerMember = integerMember;
}
@Override
public final Builder integerMember(Integer integerMember) {
this.integerMember = integerMember;
return this;
}
public final Boolean getBooleanMember() {
return booleanMember;
}
public final void setBooleanMember(Boolean booleanMember) {
this.booleanMember = booleanMember;
}
@Override
public final Builder booleanMember(Boolean booleanMember) {
this.booleanMember = booleanMember;
return this;
}
public final Float getFloatMember() {
return floatMember;
}
public final void setFloatMember(Float floatMember) {
this.floatMember = floatMember;
}
@Override
public final Builder floatMember(Float floatMember) {
this.floatMember = floatMember;
return this;
}
public final Double getDoubleMember() {
return doubleMember;
}
public final void setDoubleMember(Double doubleMember) {
this.doubleMember = doubleMember;
}
@Override
public final Builder doubleMember(Double doubleMember) {
this.doubleMember = doubleMember;
return this;
}
public final Long getLongMember() {
return longMember;
}
public final void setLongMember(Long longMember) {
this.longMember = longMember;
}
@Override
public final Builder longMember(Long longMember) {
this.longMember = longMember;
return this;
}
public final Short getShortMember() {
return shortMember;
}
public final void setShortMember(Short shortMember) {
this.shortMember = shortMember;
}
@Override
public final Builder shortMember(Short shortMember) {
this.shortMember = shortMember;
return this;
}
public final Collection<String> getSimpleList() {
if (simpleList instanceof SdkAutoConstructList) {
return null;
}
return simpleList;
}
public final void setSimpleList(Collection<String> simpleList) {
this.simpleList = ListOfStringsCopier.copy(simpleList);
}
@Override
public final Builder simpleList(Collection<String> simpleList) {
this.simpleList = ListOfStringsCopier.copy(simpleList);
return this;
}
@Override
@SafeVarargs
public final Builder simpleList(String... simpleList) {
simpleList(Arrays.asList(simpleList));
return this;
}
public final Collection<String> getListOfEnums() {
if (listOfEnums instanceof SdkAutoConstructList) {
return null;
}
return listOfEnums;
}
public final void setListOfEnums(Collection<String> listOfEnums) {
this.listOfEnums = ListOfEnumsCopier.copy(listOfEnums);
}
@Override
public final Builder listOfEnumsWithStrings(Collection<String> listOfEnums) {
this.listOfEnums = ListOfEnumsCopier.copy(listOfEnums);
return this;
}
@Override
@SafeVarargs
public final Builder listOfEnumsWithStrings(String... listOfEnums) {
listOfEnumsWithStrings(Arrays.asList(listOfEnums));
return this;
}
@Override
public final Builder listOfEnums(Collection<EnumType> listOfEnums) {
this.listOfEnums = ListOfEnumsCopier.copyEnumToString(listOfEnums);
return this;
}
@Override
@SafeVarargs
public final Builder listOfEnums(EnumType... listOfEnums) {
listOfEnums(Arrays.asList(listOfEnums));
return this;
}
public final Collection<? extends Map<String, String>> getListOfMaps() {
if (listOfMaps instanceof SdkAutoConstructList) {
return null;
}
return listOfMaps;
}
public final void setListOfMaps(Collection<? extends Map<String, String>> listOfMaps) {
this.listOfMaps = ListOfMapStringToStringCopier.copy(listOfMaps);
}
@Override
public final Builder listOfMaps(Collection<? extends Map<String, String>> listOfMaps) {
this.listOfMaps = ListOfMapStringToStringCopier.copy(listOfMaps);
return this;
}
@Override
@SafeVarargs
public final Builder listOfMaps(Map<String, String>... listOfMaps) {
listOfMaps(Arrays.asList(listOfMaps));
return this;
}
public final List<SimpleStruct.Builder> getListOfStructs() {
List<SimpleStruct.Builder> result = ListOfSimpleStructsCopier.copyToBuilder(this.listOfStructs);
if (result instanceof SdkAutoConstructList) {
return null;
}
return result;
}
public final void setListOfStructs(Collection<SimpleStruct.BuilderImpl> listOfStructs) {
this.listOfStructs = ListOfSimpleStructsCopier.copyFromBuilder(listOfStructs);
}
@Override
public final Builder listOfStructs(Collection<SimpleStruct> listOfStructs) {
this.listOfStructs = ListOfSimpleStructsCopier.copy(listOfStructs);
return this;
}
@Override
@SafeVarargs
public final Builder listOfStructs(SimpleStruct... listOfStructs) {
listOfStructs(Arrays.asList(listOfStructs));
return this;
}
@Override
@SafeVarargs
public final Builder listOfStructs(Consumer<SimpleStruct.Builder>... listOfStructs) {
listOfStructs(Stream.of(listOfStructs).map(c -> SimpleStruct.builder().applyMutation(c).build())
.collect(Collectors.toList()));
return this;
}
public final Collection<? extends Map<String, String>> getListOfMapOfEnumToString() {
if (listOfMapOfEnumToString instanceof SdkAutoConstructList) {
return null;
}
return listOfMapOfEnumToString;
}
public final void setListOfMapOfEnumToString(Collection<? extends Map<String, String>> listOfMapOfEnumToString) {
this.listOfMapOfEnumToString = ListOfMapOfEnumToStringCopier.copy(listOfMapOfEnumToString);
}
@Override
public final Builder listOfMapOfEnumToStringWithStrings(Collection<? extends Map<String, String>> listOfMapOfEnumToString) {
this.listOfMapOfEnumToString = ListOfMapOfEnumToStringCopier.copy(listOfMapOfEnumToString);
return this;
}
@Override
@SafeVarargs
public final Builder listOfMapOfEnumToStringWithStrings(Map<String, String>... listOfMapOfEnumToString) {
listOfMapOfEnumToStringWithStrings(Arrays.asList(listOfMapOfEnumToString));
return this;
}
public final List<Map<String, SimpleStruct.Builder>> getListOfMapOfStringToStruct() {
List<Map<String, SimpleStruct.Builder>> result = ListOfMapOfStringToStructCopier
.copyToBuilder(this.listOfMapOfStringToStruct);
if (result instanceof SdkAutoConstructList) {
return null;
}
return result;
}
public final void setListOfMapOfStringToStruct(
Collection<? extends Map<String, SimpleStruct.BuilderImpl>> listOfMapOfStringToStruct) {
this.listOfMapOfStringToStruct = ListOfMapOfStringToStructCopier.copyFromBuilder(listOfMapOfStringToStruct);
}
@Override
public final Builder listOfMapOfStringToStruct(Collection<? extends Map<String, SimpleStruct>> listOfMapOfStringToStruct) {
this.listOfMapOfStringToStruct = ListOfMapOfStringToStructCopier.copy(listOfMapOfStringToStruct);
return this;
}
@Override
@SafeVarargs
public final Builder listOfMapOfStringToStruct(Map<String, SimpleStruct>... listOfMapOfStringToStruct) {
listOfMapOfStringToStruct(Arrays.asList(listOfMapOfStringToStruct));
return this;
}
public final Map<String, ? extends Collection<Integer>> getMapOfStringToIntegerList() {
if (mapOfStringToIntegerList instanceof SdkAutoConstructMap) {
return null;
}
return mapOfStringToIntegerList;
}
public final void setMapOfStringToIntegerList(Map<String, ? extends Collection<Integer>> mapOfStringToIntegerList) {
this.mapOfStringToIntegerList = MapOfStringToIntegerListCopier.copy(mapOfStringToIntegerList);
}
@Override
public final Builder mapOfStringToIntegerList(Map<String, ? extends Collection<Integer>> mapOfStringToIntegerList) {
this.mapOfStringToIntegerList = MapOfStringToIntegerListCopier.copy(mapOfStringToIntegerList);
return this;
}
public final Map<String, String> getMapOfStringToString() {
if (mapOfStringToString instanceof SdkAutoConstructMap) {
return null;
}
return mapOfStringToString;
}
public final void setMapOfStringToString(Map<String, String> mapOfStringToString) {
this.mapOfStringToString = MapOfStringToStringCopier.copy(mapOfStringToString);
}
@Override
public final Builder mapOfStringToString(Map<String, String> mapOfStringToString) {
this.mapOfStringToString = MapOfStringToStringCopier.copy(mapOfStringToString);
return this;
}
public final Map<String, SimpleStruct.Builder> getMapOfStringToSimpleStruct() {
Map<String, SimpleStruct.Builder> result = MapOfStringToSimpleStructCopier
.copyToBuilder(this.mapOfStringToSimpleStruct);
if (result instanceof SdkAutoConstructMap) {
return null;
}
return result;
}
public final void setMapOfStringToSimpleStruct(Map<String, SimpleStruct.BuilderImpl> mapOfStringToSimpleStruct) {
this.mapOfStringToSimpleStruct = MapOfStringToSimpleStructCopier.copyFromBuilder(mapOfStringToSimpleStruct);
}
@Override
public final Builder mapOfStringToSimpleStruct(Map<String, SimpleStruct> mapOfStringToSimpleStruct) {
this.mapOfStringToSimpleStruct = MapOfStringToSimpleStructCopier.copy(mapOfStringToSimpleStruct);
return this;
}
public final Map<String, String> getMapOfEnumToEnum() {
if (mapOfEnumToEnum instanceof SdkAutoConstructMap) {
return null;
}
return mapOfEnumToEnum;
}
public final void setMapOfEnumToEnum(Map<String, String> mapOfEnumToEnum) {
this.mapOfEnumToEnum = MapOfEnumToEnumCopier.copy(mapOfEnumToEnum);
}
@Override
public final Builder mapOfEnumToEnumWithStrings(Map<String, String> mapOfEnumToEnum) {
this.mapOfEnumToEnum = MapOfEnumToEnumCopier.copy(mapOfEnumToEnum);
return this;
}
@Override
public final Builder mapOfEnumToEnum(Map<EnumType, EnumType> mapOfEnumToEnum) {
this.mapOfEnumToEnum = MapOfEnumToEnumCopier.copyEnumToString(mapOfEnumToEnum);
return this;
}
public final Map<String, String> getMapOfEnumToString() {
if (mapOfEnumToString instanceof SdkAutoConstructMap) {
return null;
}
return mapOfEnumToString;
}
public final void setMapOfEnumToString(Map<String, String> mapOfEnumToString) {
this.mapOfEnumToString = MapOfEnumToStringCopier.copy(mapOfEnumToString);
}
@Override
public final Builder mapOfEnumToStringWithStrings(Map<String, String> mapOfEnumToString) {
this.mapOfEnumToString = MapOfEnumToStringCopier.copy(mapOfEnumToString);
return this;
}
@Override
public final Builder mapOfEnumToString(Map<EnumType, String> mapOfEnumToString) {
this.mapOfEnumToString = MapOfEnumToStringCopier.copyEnumToString(mapOfEnumToString);
return this;
}
public final Map<String, String> getMapOfStringToEnum() {
if (mapOfStringToEnum instanceof SdkAutoConstructMap) {
return null;
}
return mapOfStringToEnum;
}
public final void setMapOfStringToEnum(Map<String, String> mapOfStringToEnum) {
this.mapOfStringToEnum = MapOfStringToEnumCopier.copy(mapOfStringToEnum);
}
@Override
public final Builder mapOfStringToEnumWithStrings(Map<String, String> mapOfStringToEnum) {
this.mapOfStringToEnum = MapOfStringToEnumCopier.copy(mapOfStringToEnum);
return this;
}
@Override
public final Builder mapOfStringToEnum(Map<String, EnumType> mapOfStringToEnum) {
this.mapOfStringToEnum = MapOfStringToEnumCopier.copyEnumToString(mapOfStringToEnum);
return this;
}
public final Map<String, SimpleStruct.Builder> getMapOfEnumToSimpleStruct() {
Map<String, SimpleStruct.Builder> result = MapOfEnumToSimpleStructCopier.copyToBuilder(this.mapOfEnumToSimpleStruct);
if (result instanceof SdkAutoConstructMap) {
return null;
}
return result;
}
public final void setMapOfEnumToSimpleStruct(Map<String, SimpleStruct.BuilderImpl> mapOfEnumToSimpleStruct) {
this.mapOfEnumToSimpleStruct = MapOfEnumToSimpleStructCopier.copyFromBuilder(mapOfEnumToSimpleStruct);
}
@Override
public final Builder mapOfEnumToSimpleStructWithStrings(Map<String, SimpleStruct> mapOfEnumToSimpleStruct) {
this.mapOfEnumToSimpleStruct = MapOfEnumToSimpleStructCopier.copy(mapOfEnumToSimpleStruct);
return this;
}
@Override
public final Builder mapOfEnumToSimpleStruct(Map<EnumType, SimpleStruct> mapOfEnumToSimpleStruct) {
this.mapOfEnumToSimpleStruct = MapOfEnumToSimpleStructCopier.copyEnumToString(mapOfEnumToSimpleStruct);
return this;
}
public final Map<String, ? extends Collection<String>> getMapOfEnumToListOfEnums() {
if (mapOfEnumToListOfEnums instanceof SdkAutoConstructMap) {
return null;
}
return mapOfEnumToListOfEnums;
}
public final void setMapOfEnumToListOfEnums(Map<String, ? extends Collection<String>> mapOfEnumToListOfEnums) {
this.mapOfEnumToListOfEnums = MapOfEnumToListOfEnumsCopier.copy(mapOfEnumToListOfEnums);
}
@Override
public final Builder mapOfEnumToListOfEnumsWithStrings(Map<String, ? extends Collection<String>> mapOfEnumToListOfEnums) {
this.mapOfEnumToListOfEnums = MapOfEnumToListOfEnumsCopier.copy(mapOfEnumToListOfEnums);
return this;
}
@Override
public final Builder mapOfEnumToListOfEnums(Map<EnumType, ? extends Collection<EnumType>> mapOfEnumToListOfEnums) {
this.mapOfEnumToListOfEnums = MapOfEnumToListOfEnumsCopier.copyEnumToString(mapOfEnumToListOfEnums);
return this;
}
public final Map<String, ? extends Map<String, String>> getMapOfEnumToMapOfStringToEnum() {
if (mapOfEnumToMapOfStringToEnum instanceof SdkAutoConstructMap) {
return null;
}
return mapOfEnumToMapOfStringToEnum;
}
public final void setMapOfEnumToMapOfStringToEnum(Map<String, ? extends Map<String, String>> mapOfEnumToMapOfStringToEnum) {
this.mapOfEnumToMapOfStringToEnum = MapOfEnumToMapOfStringToEnumCopier.copy(mapOfEnumToMapOfStringToEnum);
}
@Override
public final Builder mapOfEnumToMapOfStringToEnumWithStrings(
Map<String, ? extends Map<String, String>> mapOfEnumToMapOfStringToEnum) {
this.mapOfEnumToMapOfStringToEnum = MapOfEnumToMapOfStringToEnumCopier.copy(mapOfEnumToMapOfStringToEnum);
return this;
}
@Override
public final Builder mapOfEnumToMapOfStringToEnum(
Map<EnumType, ? extends Map<String, EnumType>> mapOfEnumToMapOfStringToEnum) {
this.mapOfEnumToMapOfStringToEnum = MapOfEnumToMapOfStringToEnumCopier.copyEnumToString(mapOfEnumToMapOfStringToEnum);
return this;
}
public final Instant getTimestampMember() {
return timestampMember;
}
public final void setTimestampMember(Instant timestampMember) {
this.timestampMember = timestampMember;
}
@Override
public final Builder timestampMember(Instant timestampMember) {
this.timestampMember = timestampMember;
return this;
}
public final StructWithTimestamp.Builder getStructWithNestedTimestampMember() {
return structWithNestedTimestampMember != null ? structWithNestedTimestampMember.toBuilder() : null;
}
public final void setStructWithNestedTimestampMember(StructWithTimestamp.BuilderImpl structWithNestedTimestampMember) {
this.structWithNestedTimestampMember = structWithNestedTimestampMember != null ? structWithNestedTimestampMember
.build() : null;
}
@Override
public final Builder structWithNestedTimestampMember(StructWithTimestamp structWithNestedTimestampMember) {
this.structWithNestedTimestampMember = structWithNestedTimestampMember;
return this;
}
public final ByteBuffer getBlobArg() {
return blobArg == null ? null : blobArg.asByteBuffer();
}
public final void setBlobArg(ByteBuffer blobArg) {
blobArg(blobArg == null ? null : SdkBytes.fromByteBuffer(blobArg));
}
@Override
public final Builder blobArg(SdkBytes blobArg) {
this.blobArg = blobArg;
return this;
}
public final StructWithNestedBlobType.Builder getStructWithNestedBlob() {
return structWithNestedBlob != null ? structWithNestedBlob.toBuilder() : null;
}
public final void setStructWithNestedBlob(StructWithNestedBlobType.BuilderImpl structWithNestedBlob) {
this.structWithNestedBlob = structWithNestedBlob != null ? structWithNestedBlob.build() : null;
}
@Override
public final Builder structWithNestedBlob(StructWithNestedBlobType structWithNestedBlob) {
this.structWithNestedBlob = structWithNestedBlob;
return this;
}
public final Map<String, ByteBuffer> getBlobMap() {
if (blobMap instanceof SdkAutoConstructMap) {
return null;
}
return blobMap == null ? null : blobMap.entrySet().stream()
.collect(Collectors.toMap(e -> e.getKey(), e -> e.getValue().asByteBuffer()));
}
public final void setBlobMap(Map<String, ByteBuffer> blobMap) {
blobMap(blobMap == null ? null : blobMap.entrySet().stream()
.collect(Collectors.toMap(e -> e.getKey(), e -> SdkBytes.fromByteBuffer(e.getValue()))));
}
@Override
public final Builder blobMap(Map<String, SdkBytes> blobMap) {
this.blobMap = BlobMapTypeCopier.copy(blobMap);
return this;
}
public final List<ByteBuffer> getListOfBlobs() {
if (listOfBlobs instanceof SdkAutoConstructList) {
return null;
}
return listOfBlobs == null ? null : listOfBlobs.stream().map(SdkBytes::asByteBuffer).collect(Collectors.toList());
}
public final void setListOfBlobs(Collection<ByteBuffer> listOfBlobs) {
listOfBlobs(listOfBlobs == null ? null : listOfBlobs.stream().map(SdkBytes::fromByteBuffer)
.collect(Collectors.toList()));
}
@Override
public final Builder listOfBlobs(Collection<SdkBytes> listOfBlobs) {
this.listOfBlobs = ListOfBlobsTypeCopier.copy(listOfBlobs);
return this;
}
@Override
@SafeVarargs
public final Builder listOfBlobs(SdkBytes... listOfBlobs) {
listOfBlobs(Arrays.asList(listOfBlobs));
return this;
}
public final RecursiveStructType.Builder getRecursiveStruct() {
return recursiveStruct != null ? recursiveStruct.toBuilder() : null;
}
public final void setRecursiveStruct(RecursiveStructType.BuilderImpl recursiveStruct) {
this.recursiveStruct = recursiveStruct != null ? recursiveStruct.build() : null;
}
@Override
public final Builder recursiveStruct(RecursiveStructType recursiveStruct) {
this.recursiveStruct = recursiveStruct;
return this;
}
public final BaseType.Builder getPolymorphicTypeWithSubTypes() {
return polymorphicTypeWithSubTypes != null ? polymorphicTypeWithSubTypes.toBuilder() : null;
}
public final void setPolymorphicTypeWithSubTypes(BaseType.BuilderImpl polymorphicTypeWithSubTypes) {
this.polymorphicTypeWithSubTypes = polymorphicTypeWithSubTypes != null ? polymorphicTypeWithSubTypes.build() : null;
}
@Override
public final Builder polymorphicTypeWithSubTypes(BaseType polymorphicTypeWithSubTypes) {
this.polymorphicTypeWithSubTypes = polymorphicTypeWithSubTypes;
return this;
}
public final SubTypeOne.Builder getPolymorphicTypeWithoutSubTypes() {
return polymorphicTypeWithoutSubTypes != null ? polymorphicTypeWithoutSubTypes.toBuilder() : null;
}
public final void setPolymorphicTypeWithoutSubTypes(SubTypeOne.BuilderImpl polymorphicTypeWithoutSubTypes) {
this.polymorphicTypeWithoutSubTypes = polymorphicTypeWithoutSubTypes != null ? polymorphicTypeWithoutSubTypes.build()
: null;
}
@Override
public final Builder polymorphicTypeWithoutSubTypes(SubTypeOne polymorphicTypeWithoutSubTypes) {
this.polymorphicTypeWithoutSubTypes = polymorphicTypeWithoutSubTypes;
return this;
}
public final String getEnumType() {
return enumType;
}
public final void setEnumType(String enumType) {
this.enumType = enumType;
}
@Override
public final Builder enumType(String enumType) {
this.enumType = enumType;
return this;
}
@Override
public final Builder enumType(EnumType enumType) {
this.enumType(enumType == null ? null : enumType.toString());
return this;
}
public final Underscore_Name_Type.Builder getUnderscore_Name_Type() {
return underscore_Name_Type != null ? underscore_Name_Type.toBuilder() : null;
}
public final void setUnderscore_Name_Type(Underscore_Name_Type.BuilderImpl underscore_Name_Type) {
this.underscore_Name_Type = underscore_Name_Type != null ? underscore_Name_Type.build() : null;
}
@Override
public final Builder underscore_Name_Type(Underscore_Name_Type underscore_Name_Type) {
this.underscore_Name_Type = underscore_Name_Type;
return this;
}
public final Document getMyDocument() {
return myDocument;
}
public final void setMyDocument(Document myDocument) {
this.myDocument = myDocument;
}
@Override
public final Builder myDocument(Document myDocument) {
this.myDocument = myDocument;
return this;
}
public final AllTypesUnionStructure.Builder getAllTypesUnionStructure() {
return allTypesUnionStructure != null ? allTypesUnionStructure.toBuilder() : null;
}
public final void setAllTypesUnionStructure(AllTypesUnionStructure.BuilderImpl allTypesUnionStructure) {
this.allTypesUnionStructure = allTypesUnionStructure != null ? allTypesUnionStructure.build() : null;
}
@Override
public final Builder allTypesUnionStructure(AllTypesUnionStructure allTypesUnionStructure) {
this.allTypesUnionStructure = allTypesUnionStructure;
return this;
}
@Override
public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) {
super.overrideConfiguration(overrideConfiguration);
return this;
}
@Override
public Builder overrideConfiguration(Consumer<AwsRequestOverrideConfiguration.Builder> builderConsumer) {
super.overrideConfiguration(builderConsumer);
return this;
}
@Override
public AllTypesRequest build() {
return new AllTypesRequest(this);
}
@Override
public List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
}
}
| 3,462 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/listofenumscopier.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import static java.util.stream.Collectors.toList;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
@Generated("software.amazon.awssdk:codegen")
final class ListOfEnumsCopier {
static List<String> copy(Collection<String> listOfEnumsParam) {
List<String> list;
if (listOfEnumsParam == null || listOfEnumsParam instanceof SdkAutoConstructList) {
list = DefaultSdkAutoConstructList.getInstance();
} else {
List<String> modifiableList = new ArrayList<>();
listOfEnumsParam.forEach(entry -> {
modifiableList.add(entry);
});
list = Collections.unmodifiableList(modifiableList);
}
return list;
}
static List<String> copyEnumToString(Collection<EnumType> listOfEnumsParam) {
List<String> list;
if (listOfEnumsParam == null || listOfEnumsParam instanceof SdkAutoConstructList) {
list = DefaultSdkAutoConstructList.getInstance();
} else {
List<String> modifiableList = new ArrayList<>();
listOfEnumsParam.forEach(entry -> {
String result = entry.toString();
modifiableList.add(result);
});
list = Collections.unmodifiableList(modifiableList);
}
return list;
}
static List<EnumType> copyStringToEnum(Collection<String> listOfEnumsParam) {
List<EnumType> list;
if (listOfEnumsParam == null || listOfEnumsParam instanceof SdkAutoConstructList) {
list = DefaultSdkAutoConstructList.getInstance();
} else {
List<EnumType> modifiableList = new ArrayList<>();
listOfEnumsParam.forEach(entry -> {
EnumType result = EnumType.fromValue(entry);
modifiableList.add(result);
});
list = Collections.unmodifiableList(modifiableList);
}
return list;
}
}
| 3,463 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/operationwithdeprecatedmemberresponse.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
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.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class OperationWithDeprecatedMemberResponse extends JsonProtocolTestsResponse implements
ToCopyableBuilder<OperationWithDeprecatedMemberResponse.Builder, OperationWithDeprecatedMemberResponse> {
private static final SdkField<String> MEMBER_MODELED_AS_DEPRECATED_FIELD = SdkField.<String> builder(MarshallingType.STRING)
.memberName("MemberModeledAsDeprecated")
.getter(getter(OperationWithDeprecatedMemberResponse::memberModeledAsDeprecated))
.setter(setter(Builder::memberModeledAsDeprecated))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MemberModeledAsDeprecated").build())
.build();
private static final SdkField<String> MEMBER_MODIFIED_AS_DEPRECATED_FIELD = SdkField
.<String> builder(MarshallingType.STRING)
.memberName("MemberModifiedAsDeprecated")
.getter(getter(OperationWithDeprecatedMemberResponse::memberModifiedAsDeprecated))
.setter(setter(Builder::memberModifiedAsDeprecated))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MemberModifiedAsDeprecated").build())
.build();
private static final SdkField<String> UNDEPRECATED_MEMBER_FIELD = SdkField.<String> builder(MarshallingType.STRING)
.memberName("UndeprecatedMember").getter(getter(OperationWithDeprecatedMemberResponse::undeprecatedMember))
.setter(setter(Builder::undeprecatedMember))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("UndeprecatedMember").build())
.build();
private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(
MEMBER_MODELED_AS_DEPRECATED_FIELD, MEMBER_MODIFIED_AS_DEPRECATED_FIELD, UNDEPRECATED_MEMBER_FIELD));
private final String memberModeledAsDeprecated;
private final String memberModifiedAsDeprecated;
private final String undeprecatedMember;
private OperationWithDeprecatedMemberResponse(BuilderImpl builder) {
super(builder);
this.memberModeledAsDeprecated = builder.memberModeledAsDeprecated;
this.memberModifiedAsDeprecated = builder.memberModifiedAsDeprecated;
this.undeprecatedMember = builder.undeprecatedMember;
}
/**
* Returns the value of the MemberModeledAsDeprecated property for this object.
*
* @return The value of the MemberModeledAsDeprecated property for this object.
* @deprecated This field is modeled as deprecated.
*/
@Deprecated
public final String memberModeledAsDeprecated() {
return memberModeledAsDeprecated;
}
/**
* Returns the value of the MemberModifiedAsDeprecated property for this object.
*
* @return The value of the MemberModifiedAsDeprecated property for this object.
*/
public final String memberModifiedAsDeprecated() {
return memberModifiedAsDeprecated;
}
/**
* Returns the value of the UndeprecatedMember property for this object.
*
* @return The value of the UndeprecatedMember property for this object.
*/
public final String undeprecatedMember() {
return undeprecatedMember;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class<? extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
hashCode = 31 * hashCode + Objects.hashCode(memberModeledAsDeprecated());
hashCode = 31 * hashCode + Objects.hashCode(memberModifiedAsDeprecated());
hashCode = 31 * hashCode + Objects.hashCode(undeprecatedMember());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof OperationWithDeprecatedMemberResponse)) {
return false;
}
OperationWithDeprecatedMemberResponse other = (OperationWithDeprecatedMemberResponse) obj;
return Objects.equals(memberModeledAsDeprecated(), other.memberModeledAsDeprecated())
&& Objects.equals(memberModifiedAsDeprecated(), other.memberModifiedAsDeprecated())
&& Objects.equals(undeprecatedMember(), other.undeprecatedMember());
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("OperationWithDeprecatedMemberResponse")
.add("MemberModeledAsDeprecated", memberModeledAsDeprecated())
.add("MemberModifiedAsDeprecated", memberModifiedAsDeprecated()).add("UndeprecatedMember", undeprecatedMember())
.build();
}
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
switch (fieldName) {
case "MemberModeledAsDeprecated":
return Optional.ofNullable(clazz.cast(memberModeledAsDeprecated()));
case "MemberModifiedAsDeprecated":
return Optional.ofNullable(clazz.cast(memberModifiedAsDeprecated()));
case "UndeprecatedMember":
return Optional.ofNullable(clazz.cast(undeprecatedMember()));
default:
return Optional.empty();
}
}
@Override
public final List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
private static <T> Function<Object, T> getter(Function<OperationWithDeprecatedMemberResponse, T> g) {
return obj -> g.apply((OperationWithDeprecatedMemberResponse) obj);
}
private static <T> BiConsumer<Object, T> setter(BiConsumer<Builder, T> s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
public interface Builder extends JsonProtocolTestsResponse.Builder, SdkPojo,
CopyableBuilder<Builder, OperationWithDeprecatedMemberResponse> {
/**
* Sets the value of the MemberModeledAsDeprecated property for this object.
*
* @param memberModeledAsDeprecated
* The new value for the MemberModeledAsDeprecated property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
* @deprecated This field is modeled as deprecated.
*/
@Deprecated
Builder memberModeledAsDeprecated(String memberModeledAsDeprecated);
/**
* Sets the value of the MemberModifiedAsDeprecated property for this object.
*
* @param memberModifiedAsDeprecated
* The new value for the MemberModifiedAsDeprecated property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder memberModifiedAsDeprecated(String memberModifiedAsDeprecated);
/**
* Sets the value of the UndeprecatedMember property for this object.
*
* @param undeprecatedMember
* The new value for the UndeprecatedMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder undeprecatedMember(String undeprecatedMember);
}
static final class BuilderImpl extends JsonProtocolTestsResponse.BuilderImpl implements Builder {
private String memberModeledAsDeprecated;
private String memberModifiedAsDeprecated;
private String undeprecatedMember;
private BuilderImpl() {
}
private BuilderImpl(OperationWithDeprecatedMemberResponse model) {
super(model);
memberModeledAsDeprecated(model.memberModeledAsDeprecated);
memberModifiedAsDeprecated(model.memberModifiedAsDeprecated);
undeprecatedMember(model.undeprecatedMember);
}
@Deprecated
public final String getMemberModeledAsDeprecated() {
return memberModeledAsDeprecated;
}
@Deprecated
public final void setMemberModeledAsDeprecated(String memberModeledAsDeprecated) {
this.memberModeledAsDeprecated = memberModeledAsDeprecated;
}
@Override
@Deprecated
public final Builder memberModeledAsDeprecated(String memberModeledAsDeprecated) {
this.memberModeledAsDeprecated = memberModeledAsDeprecated;
return this;
}
public final String getMemberModifiedAsDeprecated() {
return memberModifiedAsDeprecated;
}
public final void setMemberModifiedAsDeprecated(String memberModifiedAsDeprecated) {
this.memberModifiedAsDeprecated = memberModifiedAsDeprecated;
}
@Override
public final Builder memberModifiedAsDeprecated(String memberModifiedAsDeprecated) {
this.memberModifiedAsDeprecated = memberModifiedAsDeprecated;
return this;
}
public final String getUndeprecatedMember() {
return undeprecatedMember;
}
public final void setUndeprecatedMember(String undeprecatedMember) {
this.undeprecatedMember = undeprecatedMember;
}
@Override
public final Builder undeprecatedMember(String undeprecatedMember) {
this.undeprecatedMember = undeprecatedMember;
return this;
}
@Override
public OperationWithDeprecatedMemberResponse build() {
return new OperationWithDeprecatedMemberResponse(this);
}
@Override
public List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
}
}
| 3,464 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/serviceclientconfiguration-builder.java | package software.amazon.awssdk.services.jsonprotocoltests.internal;
import java.net.URI;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.annotations.SdkInternalApi;
import software.amazon.awssdk.awscore.client.config.AwsClientOption;
import software.amazon.awssdk.core.client.config.ClientOverrideConfiguration;
import software.amazon.awssdk.core.client.config.SdkClientConfiguration;
import software.amazon.awssdk.core.client.config.SdkClientOption;
import software.amazon.awssdk.endpoints.EndpointProvider;
import software.amazon.awssdk.http.auth.spi.scheme.AuthScheme;
import software.amazon.awssdk.http.auth.spi.scheme.AuthSchemeProvider;
import software.amazon.awssdk.identity.spi.AwsCredentialsIdentity;
import software.amazon.awssdk.identity.spi.IdentityProvider;
import software.amazon.awssdk.regions.Region;
import software.amazon.awssdk.services.jsonprotocoltests.JsonProtocolTestsServiceClientConfiguration;
import software.amazon.awssdk.services.jsonprotocoltests.auth.scheme.JsonProtocolTestsAuthSchemeProvider;
import software.amazon.awssdk.utils.Validate;
@Generated("software.amazon.awssdk:codegen")
@SdkInternalApi
public class JsonProtocolTestsServiceClientConfigurationBuilder implements JsonProtocolTestsServiceClientConfiguration.Builder {
private final SdkClientConfiguration.Builder config;
public JsonProtocolTestsServiceClientConfigurationBuilder() {
this(SdkClientConfiguration.builder());
}
public JsonProtocolTestsServiceClientConfigurationBuilder(SdkClientConfiguration.Builder config) {
this.config = config;
}
/**
* Sets the value for client override configuration
*/
@Override
public JsonProtocolTestsServiceClientConfiguration.Builder overrideConfiguration(
ClientOverrideConfiguration overrideConfiguration) {
config.putAll(overrideConfiguration);
return this;
}
/**
* Gets the value for client override configuration
*/
@Override
public ClientOverrideConfiguration overrideConfiguration() {
return config.asOverrideConfigurationBuilder().build();
}
/**
* Sets the value for endpoint override
*/
@Override
public JsonProtocolTestsServiceClientConfiguration.Builder endpointOverride(URI endpointOverride) {
if (endpointOverride != null) {
config.option(SdkClientOption.ENDPOINT, endpointOverride);
config.option(SdkClientOption.ENDPOINT_OVERRIDDEN, true);
} else {
config.option(SdkClientOption.ENDPOINT, null);
config.option(SdkClientOption.ENDPOINT_OVERRIDDEN, false);
}
return this;
}
/**
* Gets the value for endpoint override
*/
@Override
public URI endpointOverride() {
if (Boolean.TRUE.equals(config.option(SdkClientOption.ENDPOINT_OVERRIDDEN))) {
return config.option(SdkClientOption.ENDPOINT);
}
return null;
}
/**
* Sets the value for endpoint provider
*/
@Override
public JsonProtocolTestsServiceClientConfiguration.Builder endpointProvider(EndpointProvider endpointProvider) {
config.option(SdkClientOption.ENDPOINT_PROVIDER, endpointProvider);
return this;
}
/**
* Gets the value for endpoint provider
*/
@Override
public EndpointProvider endpointProvider() {
return config.option(SdkClientOption.ENDPOINT_PROVIDER);
}
/**
* Sets the value for AWS region
*/
@Override
public JsonProtocolTestsServiceClientConfiguration.Builder region(Region region) {
config.option(AwsClientOption.AWS_REGION, region);
return this;
}
/**
* Gets the value for AWS region
*/
@Override
public Region region() {
return config.option(AwsClientOption.AWS_REGION);
}
/**
* Sets the value for credentials provider
*/
@Override
public JsonProtocolTestsServiceClientConfiguration.Builder credentialsProvider(
IdentityProvider<? extends AwsCredentialsIdentity> credentialsProvider) {
config.option(AwsClientOption.CREDENTIALS_IDENTITY_PROVIDER, credentialsProvider);
return this;
}
/**
* Gets the value for credentials provider
*/
@Override
public IdentityProvider<? extends AwsCredentialsIdentity> credentialsProvider() {
return config.option(AwsClientOption.CREDENTIALS_IDENTITY_PROVIDER);
}
@Override
public JsonProtocolTestsServiceClientConfiguration.Builder putAuthScheme(AuthScheme<?> authScheme) {
config.computeOptionIfAbsent(SdkClientOption.AUTH_SCHEMES, HashMap::new).put(authScheme.schemeId(), authScheme);
return this;
}
/**
* Gets the value for auth schemes
*/
@Override
public Map<String, AuthScheme<?>> authSchemes() {
Map<String, AuthScheme<?>> authSchemes = config.option(SdkClientOption.AUTH_SCHEMES);
return Collections.unmodifiableMap(authSchemes == null ? Collections.emptyMap() : authSchemes);
}
/**
* Sets the value for auth scheme provider
*/
@Override
public JsonProtocolTestsServiceClientConfiguration.Builder authSchemeProvider(
JsonProtocolTestsAuthSchemeProvider authSchemeProvider) {
config.option(SdkClientOption.AUTH_SCHEME_PROVIDER, authSchemeProvider);
return this;
}
/**
* Gets the value for auth scheme provider
*/
@Override
public JsonProtocolTestsAuthSchemeProvider authSchemeProvider() {
AuthSchemeProvider result = config.option(SdkClientOption.AUTH_SCHEME_PROVIDER);
if (result == null) {
return null;
}
return Validate.isInstanceOf(JsonProtocolTestsAuthSchemeProvider.class, result, "Expected an instance of "
+ JsonProtocolTestsAuthSchemeProvider.class.getSimpleName());
}
@Override
public JsonProtocolTestsServiceClientConfiguration build() {
return new JsonProtocolTestsServiceClientConfiguration(this);
}
}
| 3,465 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/baseserviceexception.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.awscore.exception.AwsErrorDetails;
import software.amazon.awssdk.awscore.exception.AwsServiceException;
@Generated("software.amazon.awssdk:codegen")
public class JsonProtocolTestsException extends AwsServiceException {
protected JsonProtocolTestsException(Builder builder) {
super(builder);
}
public static Builder builder() {
return new BuilderImpl();
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Class<? extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
public interface Builder extends AwsServiceException.Builder {
@Override
Builder awsErrorDetails(AwsErrorDetails awsErrorDetails);
@Override
Builder message(String message);
@Override
Builder requestId(String requestId);
@Override
Builder statusCode(int statusCode);
@Override
Builder cause(Throwable cause);
@Override
Builder writableStackTrace(Boolean writableStackTrace);
}
protected static class BuilderImpl extends AwsServiceException.BuilderImpl implements Builder {
protected BuilderImpl() {
}
protected BuilderImpl(JsonProtocolTestsException ex) {
super(ex);
}
@Override
public BuilderImpl awsErrorDetails(AwsErrorDetails awsErrorDetails) {
this.awsErrorDetails = awsErrorDetails;
return this;
}
@Override
public BuilderImpl message(String message) {
this.message = message;
return this;
}
@Override
public BuilderImpl requestId(String requestId) {
this.requestId = requestId;
return this;
}
@Override
public BuilderImpl statusCode(int statusCode) {
this.statusCode = statusCode;
return this;
}
@Override
public BuilderImpl cause(Throwable cause) {
this.cause = cause;
return this;
}
@Override
public BuilderImpl writableStackTrace(Boolean writableStackTrace) {
this.writableStackTrace = writableStackTrace;
return this;
}
@Override
public JsonProtocolTestsException build() {
return new JsonProtocolTestsException(this);
}
}
}
| 3,466 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/xmlnamespace/testxmlnamespaceresponse.java | package software.amazon.awssdk.services.protocolrestxml.model;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
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.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.XmlAttributesTrait;
import software.amazon.awssdk.utils.Pair;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class TestXmlNamespaceResponse extends ProtocolRestXmlResponse implements
ToCopyableBuilder<TestXmlNamespaceResponse.Builder, TestXmlNamespaceResponse> {
private static final SdkField<String> STRING_MEMBER_FIELD = SdkField
.<String> builder(MarshallingType.STRING)
.memberName("stringMember")
.getter(getter(TestXmlNamespaceResponse::stringMember))
.setter(setter(Builder::stringMember))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("stringMember")
.unmarshallLocationName("stringMember").build()).build();
private static final SdkField<Integer> INTEGER_MEMBER_FIELD = SdkField
.<Integer> builder(MarshallingType.INTEGER)
.memberName("integerMember")
.getter(getter(TestXmlNamespaceResponse::integerMember))
.setter(setter(Builder::integerMember))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("integerMember")
.unmarshallLocationName("integerMember").build()).build();
private static final SdkField<XmlNamespaceMember> XML_NAMESPACE_MEMBER_FIELD = SdkField
.<XmlNamespaceMember> builder(MarshallingType.SDK_POJO)
.memberName("xmlNamespaceMember")
.getter(getter(TestXmlNamespaceResponse::xmlNamespaceMember))
.setter(setter(Builder::xmlNamespaceMember))
.constructor(XmlNamespaceMember::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("xmlNamespaceMember")
.unmarshallLocationName("xmlNamespaceMember").build(),
XmlAttributesTrait.create(
Pair.of("xmlns:foo",
XmlAttributesTrait.AttributeAccessors.builder().attributeGetter((ignore) -> "http://bar")
.build()),
Pair.of("foo:type",
XmlAttributesTrait.AttributeAccessors.builder()
.attributeGetter(t -> ((XmlNamespaceMember) t).type()).build()))).build();
private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(STRING_MEMBER_FIELD,
INTEGER_MEMBER_FIELD, XML_NAMESPACE_MEMBER_FIELD));
private final String stringMember;
private final Integer integerMember;
private final XmlNamespaceMember xmlNamespaceMember;
private TestXmlNamespaceResponse(BuilderImpl builder) {
super(builder);
this.stringMember = builder.stringMember;
this.integerMember = builder.integerMember;
this.xmlNamespaceMember = builder.xmlNamespaceMember;
}
/**
* Returns the value of the StringMember property for this object.
*
* @return The value of the StringMember property for this object.
*/
public final String stringMember() {
return stringMember;
}
/**
* Returns the value of the IntegerMember property for this object.
*
* @return The value of the IntegerMember property for this object.
*/
public final Integer integerMember() {
return integerMember;
}
/**
* Returns the value of the XmlNamespaceMember property for this object.
*
* @return The value of the XmlNamespaceMember property for this object.
*/
public final XmlNamespaceMember xmlNamespaceMember() {
return xmlNamespaceMember;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class<? extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
hashCode = 31 * hashCode + Objects.hashCode(stringMember());
hashCode = 31 * hashCode + Objects.hashCode(integerMember());
hashCode = 31 * hashCode + Objects.hashCode(xmlNamespaceMember());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof TestXmlNamespaceResponse)) {
return false;
}
TestXmlNamespaceResponse other = (TestXmlNamespaceResponse) obj;
return Objects.equals(stringMember(), other.stringMember()) && Objects.equals(integerMember(), other.integerMember())
&& Objects.equals(xmlNamespaceMember(), other.xmlNamespaceMember());
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("TestXmlNamespaceResponse").add("StringMember", stringMember())
.add("IntegerMember", integerMember()).add("XmlNamespaceMember", xmlNamespaceMember()).build();
}
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
switch (fieldName) {
case "stringMember":
return Optional.ofNullable(clazz.cast(stringMember()));
case "integerMember":
return Optional.ofNullable(clazz.cast(integerMember()));
case "xmlNamespaceMember":
return Optional.ofNullable(clazz.cast(xmlNamespaceMember()));
default:
return Optional.empty();
}
}
@Override
public final List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
private static <T> Function<Object, T> getter(Function<TestXmlNamespaceResponse, T> g) {
return obj -> g.apply((TestXmlNamespaceResponse) obj);
}
private static <T> BiConsumer<Object, T> setter(BiConsumer<Builder, T> s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
public interface Builder extends ProtocolRestXmlResponse.Builder, SdkPojo, CopyableBuilder<Builder, TestXmlNamespaceResponse> {
/**
* Sets the value of the StringMember property for this object.
*
* @param stringMember
* The new value for the StringMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder stringMember(String stringMember);
/**
* Sets the value of the IntegerMember property for this object.
*
* @param integerMember
* The new value for the IntegerMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder integerMember(Integer integerMember);
/**
* Sets the value of the XmlNamespaceMember property for this object.
*
* @param xmlNamespaceMember
* The new value for the XmlNamespaceMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder xmlNamespaceMember(XmlNamespaceMember xmlNamespaceMember);
/**
* Sets the value of the XmlNamespaceMember property for this object.
*
* This is a convenience method that creates an instance of the {@link XmlNamespaceMember.Builder} avoiding the
* need to create one manually via {@link XmlNamespaceMember#builder()}.
*
* <p>
* When the {@link Consumer} completes, {@link XmlNamespaceMember.Builder#build()} is called immediately and its
* result is passed to {@link #xmlNamespaceMember(XmlNamespaceMember)}.
*
* @param xmlNamespaceMember
* a consumer that will call methods on {@link XmlNamespaceMember.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #xmlNamespaceMember(XmlNamespaceMember)
*/
default Builder xmlNamespaceMember(Consumer<XmlNamespaceMember.Builder> xmlNamespaceMember) {
return xmlNamespaceMember(XmlNamespaceMember.builder().applyMutation(xmlNamespaceMember).build());
}
}
static final class BuilderImpl extends ProtocolRestXmlResponse.BuilderImpl implements Builder {
private String stringMember;
private Integer integerMember;
private XmlNamespaceMember xmlNamespaceMember;
private BuilderImpl() {
}
private BuilderImpl(TestXmlNamespaceResponse model) {
super(model);
stringMember(model.stringMember);
integerMember(model.integerMember);
xmlNamespaceMember(model.xmlNamespaceMember);
}
public final String getStringMember() {
return stringMember;
}
public final void setStringMember(String stringMember) {
this.stringMember = stringMember;
}
@Override
public final Builder stringMember(String stringMember) {
this.stringMember = stringMember;
return this;
}
public final Integer getIntegerMember() {
return integerMember;
}
public final void setIntegerMember(Integer integerMember) {
this.integerMember = integerMember;
}
@Override
public final Builder integerMember(Integer integerMember) {
this.integerMember = integerMember;
return this;
}
public final XmlNamespaceMember.Builder getXmlNamespaceMember() {
return xmlNamespaceMember != null ? xmlNamespaceMember.toBuilder() : null;
}
public final void setXmlNamespaceMember(XmlNamespaceMember.BuilderImpl xmlNamespaceMember) {
this.xmlNamespaceMember = xmlNamespaceMember != null ? xmlNamespaceMember.build() : null;
}
@Override
public final Builder xmlNamespaceMember(XmlNamespaceMember xmlNamespaceMember) {
this.xmlNamespaceMember = xmlNamespaceMember;
return this;
}
@Override
public TestXmlNamespaceResponse build() {
return new TestXmlNamespaceResponse(this);
}
@Override
public List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
}
}
| 3,467 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/xmlnamespace/testxmlnamespacerequest.java | package software.amazon.awssdk.services.protocolrestxml.model;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
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.AwsRequestOverrideConfiguration;
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.XmlAttributesTrait;
import software.amazon.awssdk.utils.Pair;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class TestXmlNamespaceRequest extends ProtocolRestXmlRequest implements
ToCopyableBuilder<TestXmlNamespaceRequest.Builder, TestXmlNamespaceRequest> {
private static final SdkField<String> STRING_MEMBER_FIELD = SdkField
.<String> builder(MarshallingType.STRING)
.memberName("stringMember")
.getter(getter(TestXmlNamespaceRequest::stringMember))
.setter(setter(Builder::stringMember))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("stringMember")
.unmarshallLocationName("stringMember").build()).build();
private static final SdkField<Integer> INTEGER_MEMBER_FIELD = SdkField
.<Integer> builder(MarshallingType.INTEGER)
.memberName("integerMember")
.getter(getter(TestXmlNamespaceRequest::integerMember))
.setter(setter(Builder::integerMember))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("integerMember")
.unmarshallLocationName("integerMember").build()).build();
private static final SdkField<XmlNamespaceMember> XML_NAMESPACE_MEMBER_FIELD = SdkField
.<XmlNamespaceMember> builder(MarshallingType.SDK_POJO)
.memberName("xmlNamespaceMember")
.getter(getter(TestXmlNamespaceRequest::xmlNamespaceMember))
.setter(setter(Builder::xmlNamespaceMember))
.constructor(XmlNamespaceMember::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("xmlNamespaceMember")
.unmarshallLocationName("xmlNamespaceMember").build(),
XmlAttributesTrait.create(
Pair.of("xmlns:foo",
XmlAttributesTrait.AttributeAccessors.builder().attributeGetter((ignore) -> "http://bar")
.build()),
Pair.of("foo:type",
XmlAttributesTrait.AttributeAccessors.builder()
.attributeGetter(t -> ((XmlNamespaceMember) t).type()).build()))).build();
private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(STRING_MEMBER_FIELD,
INTEGER_MEMBER_FIELD, XML_NAMESPACE_MEMBER_FIELD));
private final String stringMember;
private final Integer integerMember;
private final XmlNamespaceMember xmlNamespaceMember;
private TestXmlNamespaceRequest(BuilderImpl builder) {
super(builder);
this.stringMember = builder.stringMember;
this.integerMember = builder.integerMember;
this.xmlNamespaceMember = builder.xmlNamespaceMember;
}
/**
* Returns the value of the StringMember property for this object.
*
* @return The value of the StringMember property for this object.
*/
public final String stringMember() {
return stringMember;
}
/**
* Returns the value of the IntegerMember property for this object.
*
* @return The value of the IntegerMember property for this object.
*/
public final Integer integerMember() {
return integerMember;
}
/**
* Returns the value of the XmlNamespaceMember property for this object.
*
* @return The value of the XmlNamespaceMember property for this object.
*/
public final XmlNamespaceMember xmlNamespaceMember() {
return xmlNamespaceMember;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class<? extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
hashCode = 31 * hashCode + Objects.hashCode(stringMember());
hashCode = 31 * hashCode + Objects.hashCode(integerMember());
hashCode = 31 * hashCode + Objects.hashCode(xmlNamespaceMember());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof TestXmlNamespaceRequest)) {
return false;
}
TestXmlNamespaceRequest other = (TestXmlNamespaceRequest) obj;
return Objects.equals(stringMember(), other.stringMember()) && Objects.equals(integerMember(), other.integerMember())
&& Objects.equals(xmlNamespaceMember(), other.xmlNamespaceMember());
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("TestXmlNamespaceRequest").add("StringMember", stringMember())
.add("IntegerMember", integerMember()).add("XmlNamespaceMember", xmlNamespaceMember()).build();
}
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
switch (fieldName) {
case "stringMember":
return Optional.ofNullable(clazz.cast(stringMember()));
case "integerMember":
return Optional.ofNullable(clazz.cast(integerMember()));
case "xmlNamespaceMember":
return Optional.ofNullable(clazz.cast(xmlNamespaceMember()));
default:
return Optional.empty();
}
}
@Override
public final List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
private static <T> Function<Object, T> getter(Function<TestXmlNamespaceRequest, T> g) {
return obj -> g.apply((TestXmlNamespaceRequest) obj);
}
private static <T> BiConsumer<Object, T> setter(BiConsumer<Builder, T> s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
public interface Builder extends ProtocolRestXmlRequest.Builder, SdkPojo, CopyableBuilder<Builder, TestXmlNamespaceRequest> {
/**
* Sets the value of the StringMember property for this object.
*
* @param stringMember
* The new value for the StringMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder stringMember(String stringMember);
/**
* Sets the value of the IntegerMember property for this object.
*
* @param integerMember
* The new value for the IntegerMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder integerMember(Integer integerMember);
/**
* Sets the value of the XmlNamespaceMember property for this object.
*
* @param xmlNamespaceMember
* The new value for the XmlNamespaceMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder xmlNamespaceMember(XmlNamespaceMember xmlNamespaceMember);
/**
* Sets the value of the XmlNamespaceMember property for this object.
*
* This is a convenience method that creates an instance of the {@link XmlNamespaceMember.Builder} avoiding the
* need to create one manually via {@link XmlNamespaceMember#builder()}.
*
* <p>
* When the {@link Consumer} completes, {@link XmlNamespaceMember.Builder#build()} is called immediately and its
* result is passed to {@link #xmlNamespaceMember(XmlNamespaceMember)}.
*
* @param xmlNamespaceMember
* a consumer that will call methods on {@link XmlNamespaceMember.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #xmlNamespaceMember(XmlNamespaceMember)
*/
default Builder xmlNamespaceMember(Consumer<XmlNamespaceMember.Builder> xmlNamespaceMember) {
return xmlNamespaceMember(XmlNamespaceMember.builder().applyMutation(xmlNamespaceMember).build());
}
@Override
Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration);
@Override
Builder overrideConfiguration(Consumer<AwsRequestOverrideConfiguration.Builder> builderConsumer);
}
static final class BuilderImpl extends ProtocolRestXmlRequest.BuilderImpl implements Builder {
private String stringMember;
private Integer integerMember;
private XmlNamespaceMember xmlNamespaceMember;
private BuilderImpl() {
}
private BuilderImpl(TestXmlNamespaceRequest model) {
super(model);
stringMember(model.stringMember);
integerMember(model.integerMember);
xmlNamespaceMember(model.xmlNamespaceMember);
}
public final String getStringMember() {
return stringMember;
}
public final void setStringMember(String stringMember) {
this.stringMember = stringMember;
}
@Override
public final Builder stringMember(String stringMember) {
this.stringMember = stringMember;
return this;
}
public final Integer getIntegerMember() {
return integerMember;
}
public final void setIntegerMember(Integer integerMember) {
this.integerMember = integerMember;
}
@Override
public final Builder integerMember(Integer integerMember) {
this.integerMember = integerMember;
return this;
}
public final XmlNamespaceMember.Builder getXmlNamespaceMember() {
return xmlNamespaceMember != null ? xmlNamespaceMember.toBuilder() : null;
}
public final void setXmlNamespaceMember(XmlNamespaceMember.BuilderImpl xmlNamespaceMember) {
this.xmlNamespaceMember = xmlNamespaceMember != null ? xmlNamespaceMember.build() : null;
}
@Override
public final Builder xmlNamespaceMember(XmlNamespaceMember xmlNamespaceMember) {
this.xmlNamespaceMember = xmlNamespaceMember;
return this;
}
@Override
public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) {
super.overrideConfiguration(overrideConfiguration);
return this;
}
@Override
public Builder overrideConfiguration(Consumer<AwsRequestOverrideConfiguration.Builder> builderConsumer) {
super.overrideConfiguration(builderConsumer);
return this;
}
@Override
public TestXmlNamespaceRequest build() {
return new TestXmlNamespaceRequest(this);
}
@Override
public List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
}
}
| 3,468 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/xmlnamespace/xmlnamespacemember.java | package software.amazon.awssdk.services.protocolrestxml.model;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
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.XmlAttributeTrait;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class XmlNamespaceMember implements SdkPojo, Serializable,
ToCopyableBuilder<XmlNamespaceMember.Builder, XmlNamespaceMember> {
private static final SdkField<String> TYPE_FIELD = SdkField
.<String> builder(MarshallingType.STRING)
.memberName("Type")
.getter(getter(XmlNamespaceMember::type))
.setter(setter(Builder::type))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("foo:type")
.unmarshallLocationName("foo:type").build(), XmlAttributeTrait.create()).build();
private static final SdkField<String> STRING_MEMBER_FIELD = SdkField
.<String> builder(MarshallingType.STRING)
.memberName("stringMember")
.getter(getter(XmlNamespaceMember::stringMember))
.setter(setter(Builder::stringMember))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("stringMember")
.unmarshallLocationName("stringMember").build()).build();
private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(TYPE_FIELD,
STRING_MEMBER_FIELD));
private static final long serialVersionUID = 1L;
private final String type;
private final String stringMember;
private XmlNamespaceMember(BuilderImpl builder) {
this.type = builder.type;
this.stringMember = builder.stringMember;
}
/**
* Returns the value of the Type property for this object.
*
* @return The value of the Type property for this object.
*/
public final String type() {
return type;
}
/**
* Returns the value of the StringMember property for this object.
*
* @return The value of the StringMember property for this object.
*/
public final String stringMember() {
return stringMember;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class<? extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(type());
hashCode = 31 * hashCode + Objects.hashCode(stringMember());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof XmlNamespaceMember)) {
return false;
}
XmlNamespaceMember other = (XmlNamespaceMember) obj;
return Objects.equals(type(), other.type()) && Objects.equals(stringMember(), other.stringMember());
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("XmlNamespaceMember").add("Type", type()).add("StringMember", stringMember()).build();
}
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
switch (fieldName) {
case "Type":
return Optional.ofNullable(clazz.cast(type()));
case "stringMember":
return Optional.ofNullable(clazz.cast(stringMember()));
default:
return Optional.empty();
}
}
@Override
public final List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
private static <T> Function<Object, T> getter(Function<XmlNamespaceMember, T> g) {
return obj -> g.apply((XmlNamespaceMember) obj);
}
private static <T> BiConsumer<Object, T> setter(BiConsumer<Builder, T> s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
public interface Builder extends SdkPojo, CopyableBuilder<Builder, XmlNamespaceMember> {
/**
* Sets the value of the Type property for this object.
*
* @param type
* The new value for the Type property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder type(String type);
/**
* Sets the value of the StringMember property for this object.
*
* @param stringMember
* The new value for the StringMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder stringMember(String stringMember);
}
static final class BuilderImpl implements Builder {
private String type;
private String stringMember;
private BuilderImpl() {
}
private BuilderImpl(XmlNamespaceMember model) {
type(model.type);
stringMember(model.stringMember);
}
public final String getType() {
return type;
}
public final void setType(String type) {
this.type = type;
}
@Override
public final Builder type(String type) {
this.type = type;
return this;
}
public final String getStringMember() {
return stringMember;
}
public final void setStringMember(String stringMember) {
this.stringMember = stringMember;
}
@Override
public final Builder stringMember(String stringMember) {
this.stringMember = stringMember;
return this;
}
@Override
public XmlNamespaceMember build() {
return new XmlNamespaceMember(this);
}
@Override
public List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
}
}
| 3,469 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/customresponsemetadata/jsonprotocoltestsresponse.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.awscore.AwsResponse;
import software.amazon.awssdk.awscore.AwsResponseMetadata;
@Generated("software.amazon.awssdk:codegen")
public abstract class JsonProtocolTestsResponse extends AwsResponse {
private final JsonProtocolTestsResponseMetadata responseMetadata;
protected JsonProtocolTestsResponse(Builder builder) {
super(builder);
this.responseMetadata = builder.responseMetadata();
}
@Override
public JsonProtocolTestsResponseMetadata responseMetadata() {
return responseMetadata;
}
public interface Builder extends AwsResponse.Builder {
@Override
JsonProtocolTestsResponse build();
@Override
JsonProtocolTestsResponseMetadata responseMetadata();
@Override
Builder responseMetadata(AwsResponseMetadata metadata);
}
protected abstract static class BuilderImpl extends AwsResponse.BuilderImpl implements Builder {
private JsonProtocolTestsResponseMetadata responseMetadata;
protected BuilderImpl() {
}
protected BuilderImpl(JsonProtocolTestsResponse response) {
super(response);
this.responseMetadata = response.responseMetadata();
}
@Override
public JsonProtocolTestsResponseMetadata responseMetadata() {
return responseMetadata;
}
@Override
public Builder responseMetadata(AwsResponseMetadata responseMetadata) {
this.responseMetadata = JsonProtocolTestsResponseMetadata.create(responseMetadata);
return this;
}
}
}
| 3,470 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/customresponsemetadata/jsonprotocoltestsresponsemetadata.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.annotations.SdkPublicApi;
import software.amazon.awssdk.awscore.AwsResponseMetadata;
@Generated("software.amazon.awssdk:codegen")
@SdkPublicApi
public final class JsonProtocolTestsResponseMetadata extends AwsResponseMetadata {
private static final String BAR_ID = "x-bar-id";
private static final String FOO_ID = "x-foo-id";
private static final String REQUEST_ID = "x-foobar-id";
private JsonProtocolTestsResponseMetadata(AwsResponseMetadata responseMetadata) {
super(responseMetadata);
}
public static JsonProtocolTestsResponseMetadata create(AwsResponseMetadata responseMetadata) {
return new JsonProtocolTestsResponseMetadata(responseMetadata);
}
public String barId() {
return getValue(BAR_ID);
}
public String fooId() {
return getValue(FOO_ID);
}
@Override
public String requestId() {
return getValue(REQUEST_ID);
}
}
| 3,471 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/sharedstream/getrandompersonrequest.java | package software.amazon.awssdk.services.sharedeventstream.model;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
import java.util.function.Consumer;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
@Generated("software.amazon.awssdk:codegen")
public final class GetRandomPersonRequest extends SharedEventStreamRequest implements
ToCopyableBuilder<GetRandomPersonRequest.Builder, GetRandomPersonRequest> {
private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList());
private GetRandomPersonRequest(BuilderImpl builder) {
super(builder);
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class<? extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof GetRandomPersonRequest)) {
return false;
}
return true;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("GetRandomPersonRequest").build();
}
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
return Optional.empty();
}
@Override
public final List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
public interface Builder extends SharedEventStreamRequest.Builder, SdkPojo, CopyableBuilder<Builder, GetRandomPersonRequest> {
@Override
Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration);
@Override
Builder overrideConfiguration(Consumer<AwsRequestOverrideConfiguration.Builder> builderConsumer);
}
static final class BuilderImpl extends SharedEventStreamRequest.BuilderImpl implements Builder {
private BuilderImpl() {
}
private BuilderImpl(GetRandomPersonRequest model) {
super(model);
}
@Override
public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) {
super.overrideConfiguration(overrideConfiguration);
return this;
}
@Override
public Builder overrideConfiguration(Consumer<AwsRequestOverrideConfiguration.Builder> builderConsumer) {
super.overrideConfiguration(builderConsumer);
return this;
}
@Override
public GetRandomPersonRequest build() {
return new GetRandomPersonRequest(this);
}
@Override
public List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
}
}
| 3,472 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/sharedstream/streambirthsresponse.java | package software.amazon.awssdk.services.sharedeventstream.model;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class StreamBirthsResponse extends SharedEventStreamResponse implements
ToCopyableBuilder<StreamBirthsResponse.Builder, StreamBirthsResponse> {
private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList());
private StreamBirthsResponse(BuilderImpl builder) {
super(builder);
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class<? extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof StreamBirthsResponse)) {
return false;
}
return true;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("StreamBirthsResponse").build();
}
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
return Optional.empty();
}
@Override
public final List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
public interface Builder extends SharedEventStreamResponse.Builder, SdkPojo, CopyableBuilder<Builder, StreamBirthsResponse> {
}
static final class BuilderImpl extends SharedEventStreamResponse.BuilderImpl implements Builder {
private BuilderImpl() {
}
private BuilderImpl(StreamBirthsResponse model) {
super(model);
}
@Override
public StreamBirthsResponse build() {
return new StreamBirthsResponse(this);
}
@Override
public List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
}
}
| 3,473 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/sharedstream/streambirthsrequest.java | package software.amazon.awssdk.services.sharedeventstream.model;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
import java.util.function.Consumer;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
@Generated("software.amazon.awssdk:codegen")
public final class StreamBirthsRequest extends SharedEventStreamRequest implements
ToCopyableBuilder<StreamBirthsRequest.Builder, StreamBirthsRequest> {
private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList());
private StreamBirthsRequest(BuilderImpl builder) {
super(builder);
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class<? extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof StreamBirthsRequest)) {
return false;
}
return true;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("StreamBirthsRequest").build();
}
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
return Optional.empty();
}
@Override
public final List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
public interface Builder extends SharedEventStreamRequest.Builder, SdkPojo, CopyableBuilder<Builder, StreamBirthsRequest> {
@Override
Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration);
@Override
Builder overrideConfiguration(Consumer<AwsRequestOverrideConfiguration.Builder> builderConsumer);
}
static final class BuilderImpl extends SharedEventStreamRequest.BuilderImpl implements Builder {
private BuilderImpl() {
}
private BuilderImpl(StreamBirthsRequest model) {
super(model);
}
@Override
public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) {
super.overrideConfiguration(overrideConfiguration);
return this;
}
@Override
public Builder overrideConfiguration(Consumer<AwsRequestOverrideConfiguration.Builder> builderConsumer) {
super.overrideConfiguration(builderConsumer);
return this;
}
@Override
public StreamBirthsRequest build() {
return new StreamBirthsRequest(this);
}
@Override
public List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
}
}
| 3,474 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/sharedstream/eventstream.java | package software.amazon.awssdk.services.sharedeventstream.model;
import java.util.Collections;
import java.util.EnumSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.annotations.SdkPublicApi;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.services.sharedeventstream.model.eventstream.DefaultPerson;
import software.amazon.awssdk.utils.internal.EnumUtils;
/**
* Base interface for all event types in EventStream.
*/
@Generated("software.amazon.awssdk:codegen")
@SdkPublicApi
public interface EventStream extends SdkPojo {
/**
* Special type of {@link EventStream} for unknown types of events that this version of the SDK does not know about
*/
EventStream UNKNOWN = new EventStream() {
@Override
public List<SdkField<?>> sdkFields() {
return Collections.emptyList();
}
@Override
public void accept(StreamBirthsResponseHandler.Visitor visitor) {
visitor.visitDefault(this);
}
@Override
public void accept(StreamDeathsResponseHandler.Visitor visitor) {
visitor.visitDefault(this);
}
};
/**
* Create a builder for the {@code Person} event type for this stream.
*/
static Person.Builder personBuilder() {
return DefaultPerson.builder();
}
/**
* The type of this event. Corresponds to the {@code :event-type} header on the Message.
*/
default EventType sdkEventType() {
return EventType.UNKNOWN_TO_SDK_VERSION;
}
/**
* Calls the appropriate visit method depending on the subtype of {@link EventStream}.
*
* @param visitor
* Visitor to invoke.
*/
void accept(StreamBirthsResponseHandler.Visitor visitor);
/**
* Calls the appropriate visit method depending on the subtype of {@link EventStream}.
*
* @param visitor
* Visitor to invoke.
*/
void accept(StreamDeathsResponseHandler.Visitor visitor);
/**
* The known possible types of events for {@code EventStream}.
*/
@Generated("software.amazon.awssdk:codegen")
enum EventType {
PERSON("Person"),
UNKNOWN_TO_SDK_VERSION(null);
private static final Map<String, EventType> VALUE_MAP = EnumUtils.uniqueIndex(EventType.class, EventType::toString);
private final String value;
private EventType(String value) {
this.value = value;
}
@Override
public String toString() {
return String.valueOf(value);
}
/**
* Use this in place of valueOf to convert the raw string returned by the service into the enum value.
*
* @param value
* real value
* @return EventType corresponding to the value
*/
public static EventType fromValue(String value) {
if (value == null) {
return null;
}
return VALUE_MAP.getOrDefault(value, UNKNOWN_TO_SDK_VERSION);
}
/**
* Use this in place of {@link #values()} to return a {@link Set} of all values known to the SDK. This will
* return all known enum values except {@link #UNKNOWN_TO_SDK_VERSION}.
*
* @return a {@link Set} of known {@link EventType}s
*/
public static Set<EventType> knownValues() {
Set<EventType> knownValues = EnumSet.allOf(EventType.class);
knownValues.remove(UNKNOWN_TO_SDK_VERSION);
return knownValues;
}
}
}
| 3,475 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/sharedstream/person.java | package software.amazon.awssdk.services.sharedeventstream.model;
import java.io.Serializable;
import java.time.Instant;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
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.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.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public class Person implements SdkPojo, Serializable, ToCopyableBuilder<Person.Builder, Person>, EventStream {
private static final SdkField<String> NAME_FIELD = SdkField.<String> builder(MarshallingType.STRING).memberName("Name")
.getter(getter(Person::name)).setter(setter(Builder::name))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Name").build()).build();
private static final SdkField<Instant> BIRTHDAY_FIELD = SdkField.<Instant> builder(MarshallingType.INSTANT)
.memberName("Birthday").getter(getter(Person::birthday)).setter(setter(Builder::birthday))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Birthday").build()).build();
private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(NAME_FIELD, BIRTHDAY_FIELD));
private static final long serialVersionUID = 1L;
private final String name;
private final Instant birthday;
protected Person(BuilderImpl builder) {
this.name = builder.name;
this.birthday = builder.birthday;
}
/**
* Returns the value of the Name property for this object.
*
* @return The value of the Name property for this object.
*/
public final String name() {
return name;
}
/**
* Returns the value of the Birthday property for this object.
*
* @return The value of the Birthday property for this object.
*/
public final Instant birthday() {
return birthday;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class<? extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(name());
hashCode = 31 * hashCode + Objects.hashCode(birthday());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof Person)) {
return false;
}
Person other = (Person) obj;
return Objects.equals(name(), other.name()) && Objects.equals(birthday(), other.birthday());
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("Person").add("Name", name()).add("Birthday", birthday()).build();
}
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
switch (fieldName) {
case "Name":
return Optional.ofNullable(clazz.cast(name()));
case "Birthday":
return Optional.ofNullable(clazz.cast(birthday()));
default:
return Optional.empty();
}
}
@Override
public final Person copy(Consumer<? super Builder> modifier) {
return ToCopyableBuilder.super.copy(modifier);
}
@Override
public final List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
private static <T> Function<Object, T> getter(Function<Person, T> g) {
return obj -> g.apply((Person) obj);
}
private static <T> BiConsumer<Object, T> setter(BiConsumer<Builder, T> s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
/**
* Calls the appropriate visit method depending on the subtype of {@link Person}.
*
* @param visitor
* Visitor to invoke.
*/
@Override
public void accept(StreamBirthsResponseHandler.Visitor visitor) {
throw new UnsupportedOperationException();
}
/**
* Calls the appropriate visit method depending on the subtype of {@link Person}.
*
* @param visitor
* Visitor to invoke.
*/
@Override
public void accept(StreamDeathsResponseHandler.Visitor visitor) {
throw new UnsupportedOperationException();
}
public interface Builder extends SdkPojo, CopyableBuilder<Builder, Person> {
/**
* Sets the value of the Name property for this object.
*
* @param name
* The new value for the Name property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder name(String name);
/**
* Sets the value of the Birthday property for this object.
*
* @param birthday
* The new value for the Birthday property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder birthday(Instant birthday);
}
protected static class BuilderImpl implements Builder {
private String name;
private Instant birthday;
protected BuilderImpl() {
}
protected BuilderImpl(Person model) {
name(model.name);
birthday(model.birthday);
}
public final String getName() {
return name;
}
public final void setName(String name) {
this.name = name;
}
@Override
public final Builder name(String name) {
this.name = name;
return this;
}
public final Instant getBirthday() {
return birthday;
}
public final void setBirthday(Instant birthday) {
this.birthday = birthday;
}
@Override
public final Builder birthday(Instant birthday) {
this.birthday = birthday;
return this;
}
@Override
public Person build() {
return new Person(this);
}
@Override
public List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
}
}
| 3,476 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/sharedstream/streamdeathsrequest.java | package software.amazon.awssdk.services.sharedeventstream.model;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
import java.util.function.Consumer;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
@Generated("software.amazon.awssdk:codegen")
public final class StreamDeathsRequest extends SharedEventStreamRequest implements
ToCopyableBuilder<StreamDeathsRequest.Builder, StreamDeathsRequest> {
private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList());
private StreamDeathsRequest(BuilderImpl builder) {
super(builder);
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class<? extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof StreamDeathsRequest)) {
return false;
}
return true;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("StreamDeathsRequest").build();
}
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
return Optional.empty();
}
@Override
public final List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
public interface Builder extends SharedEventStreamRequest.Builder, SdkPojo, CopyableBuilder<Builder, StreamDeathsRequest> {
@Override
Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration);
@Override
Builder overrideConfiguration(Consumer<AwsRequestOverrideConfiguration.Builder> builderConsumer);
}
static final class BuilderImpl extends SharedEventStreamRequest.BuilderImpl implements Builder {
private BuilderImpl() {
}
private BuilderImpl(StreamDeathsRequest model) {
super(model);
}
@Override
public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) {
super.overrideConfiguration(overrideConfiguration);
return this;
}
@Override
public Builder overrideConfiguration(Consumer<AwsRequestOverrideConfiguration.Builder> builderConsumer) {
super.overrideConfiguration(builderConsumer);
return this;
}
@Override
public StreamDeathsRequest build() {
return new StreamDeathsRequest(this);
}
@Override
public List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
}
}
| 3,477 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/sharedstream/streamdeathsresponse.java | package software.amazon.awssdk.services.sharedeventstream.model;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class StreamDeathsResponse extends SharedEventStreamResponse implements
ToCopyableBuilder<StreamDeathsResponse.Builder, StreamDeathsResponse> {
private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList());
private StreamDeathsResponse(BuilderImpl builder) {
super(builder);
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class<? extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof StreamDeathsResponse)) {
return false;
}
return true;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("StreamDeathsResponse").build();
}
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
return Optional.empty();
}
@Override
public final List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
public interface Builder extends SharedEventStreamResponse.Builder, SdkPojo, CopyableBuilder<Builder, StreamDeathsResponse> {
}
static final class BuilderImpl extends SharedEventStreamResponse.BuilderImpl implements Builder {
private BuilderImpl() {
}
private BuilderImpl(StreamDeathsResponse model) {
super(model);
}
@Override
public StreamDeathsResponse build() {
return new StreamDeathsResponse(this);
}
@Override
public List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
}
}
| 3,478 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/sharedstream/getrandompersonresponse.java | package software.amazon.awssdk.services.sharedeventstream.model;
import java.time.Instant;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
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.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.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public class GetRandomPersonResponse extends SharedEventStreamResponse implements
ToCopyableBuilder<GetRandomPersonResponse.Builder, GetRandomPersonResponse> {
private static final SdkField<String> NAME_FIELD = SdkField.<String> builder(MarshallingType.STRING).memberName("Name")
.getter(getter(GetRandomPersonResponse::name)).setter(setter(Builder::name))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Name").build()).build();
private static final SdkField<Instant> BIRTHDAY_FIELD = SdkField.<Instant> builder(MarshallingType.INSTANT)
.memberName("Birthday").getter(getter(GetRandomPersonResponse::birthday)).setter(setter(Builder::birthday))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Birthday").build()).build();
private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(NAME_FIELD, BIRTHDAY_FIELD));
private final String name;
private final Instant birthday;
protected GetRandomPersonResponse(BuilderImpl builder) {
super(builder);
this.name = builder.name;
this.birthday = builder.birthday;
}
/**
* Returns the value of the Name property for this object.
*
* @return The value of the Name property for this object.
*/
public final String name() {
return name;
}
/**
* Returns the value of the Birthday property for this object.
*
* @return The value of the Birthday property for this object.
*/
public final Instant birthday() {
return birthday;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class<? extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
hashCode = 31 * hashCode + Objects.hashCode(name());
hashCode = 31 * hashCode + Objects.hashCode(birthday());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof GetRandomPersonResponse)) {
return false;
}
GetRandomPersonResponse other = (GetRandomPersonResponse) obj;
return Objects.equals(name(), other.name()) && Objects.equals(birthday(), other.birthday());
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("GetRandomPersonResponse").add("Name", name()).add("Birthday", birthday()).build();
}
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
switch (fieldName) {
case "Name":
return Optional.ofNullable(clazz.cast(name()));
case "Birthday":
return Optional.ofNullable(clazz.cast(birthday()));
default:
return Optional.empty();
}
}
@Override
public final GetRandomPersonResponse copy(Consumer<? super Builder> modifier) {
return ToCopyableBuilder.super.copy(modifier);
}
@Override
public final List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
private static <T> Function<Object, T> getter(Function<GetRandomPersonResponse, T> g) {
return obj -> g.apply((GetRandomPersonResponse) obj);
}
private static <T> BiConsumer<Object, T> setter(BiConsumer<Builder, T> s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
public interface Builder extends SharedEventStreamResponse.Builder, SdkPojo,
CopyableBuilder<Builder, GetRandomPersonResponse> {
/**
* Sets the value of the Name property for this object.
*
* @param name
* The new value for the Name property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder name(String name);
/**
* Sets the value of the Birthday property for this object.
*
* @param birthday
* The new value for the Birthday property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder birthday(Instant birthday);
}
protected static class BuilderImpl extends SharedEventStreamResponse.BuilderImpl implements Builder {
private String name;
private Instant birthday;
protected BuilderImpl() {
}
protected BuilderImpl(GetRandomPersonResponse model) {
super(model);
name(model.name);
birthday(model.birthday);
}
public final String getName() {
return name;
}
public final void setName(String name) {
this.name = name;
}
@Override
public final Builder name(String name) {
this.name = name;
return this;
}
public final Instant getBirthday() {
return birthday;
}
public final void setBirthday(Instant birthday) {
this.birthday = birthday;
}
@Override
public final Builder birthday(Instant birthday) {
this.birthday = birthday;
return this;
}
@Override
public GetRandomPersonResponse build() {
return new GetRandomPersonResponse(this);
}
@Override
public List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
}
}
| 3,479 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/nonautoconstructcontainers/existencechecknamingresponse.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
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.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.traits.MapTrait;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class ExistenceCheckNamingResponse extends JsonProtocolTestsResponse implements
ToCopyableBuilder<ExistenceCheckNamingResponse.Builder, ExistenceCheckNamingResponse> {
private static final SdkField<List<String>> BUILD_FIELD = SdkField
.<List<String>> builder(MarshallingType.LIST)
.memberName("Build")
.getter(getter(ExistenceCheckNamingResponse::build))
.setter(setter(Builder::build))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Build").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField<List<String>> SUPER_FIELD = SdkField
.<List<String>> builder(MarshallingType.LIST)
.memberName("super")
.getter(getter(ExistenceCheckNamingResponse::superValue))
.setter(setter(Builder::superValue))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("super").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField<Map<String, String>> TO_STRING_FIELD = SdkField
.<Map<String, String>> builder(MarshallingType.MAP)
.memberName("toString")
.getter(getter(ExistenceCheckNamingResponse::toStringValue))
.setter(setter(Builder::toStringValue))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("toString").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build()).build()).build();
private static final SdkField<Map<String, String>> EQUALS_FIELD = SdkField
.<Map<String, String>> builder(MarshallingType.MAP)
.memberName("equals")
.getter(getter(ExistenceCheckNamingResponse::equalsValue))
.setter(setter(Builder::equalsValue))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("equals").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build()).build()).build();
private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(BUILD_FIELD, SUPER_FIELD,
TO_STRING_FIELD, EQUALS_FIELD));
private final List<String> build;
private final List<String> superValue;
private final Map<String, String> toStringValue;
private final Map<String, String> equalsValue;
private ExistenceCheckNamingResponse(BuilderImpl builder) {
super(builder);
this.build = builder.build;
this.superValue = builder.superValue;
this.toStringValue = builder.toStringValue;
this.equalsValue = builder.equalsValue;
}
/**
* Returns true if the Build property was specified by the sender (it may be empty), or false if the sender did not
* specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS service.
*/
public final boolean hasBuild() {
return build != null && !(build instanceof SdkAutoConstructList);
}
/**
* Returns the value of the Build property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* You can use {@link #hasBuild()} to see if a value was sent in this field.
* </p>
*
* @return The value of the Build property for this object.
*/
public final List<String> build() {
return build;
}
/**
* Returns true if the Super property was specified by the sender (it may be empty), or false if the sender did not
* specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS service.
*/
public final boolean hasSuperValue() {
return superValue != null && !(superValue instanceof SdkAutoConstructList);
}
/**
* Returns the value of the Super property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* You can use {@link #hasSuperValue()} to see if a value was sent in this field.
* </p>
*
* @return The value of the Super property for this object.
*/
public final List<String> superValue() {
return superValue;
}
/**
* Returns true if the ToString property was specified by the sender (it may be empty), or false if the sender did
* not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS service.
*/
public final boolean hasToStringValue() {
return toStringValue != null && !(toStringValue instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the ToString property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* You can use {@link #hasToStringValue()} to see if a value was sent in this field.
* </p>
*
* @return The value of the ToString property for this object.
*/
public final Map<String, String> toStringValue() {
return toStringValue;
}
/**
* Returns true if the Equals property was specified by the sender (it may be empty), or false if the sender did not
* specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS service.
*/
public final boolean hasEqualsValue() {
return equalsValue != null && !(equalsValue instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the Equals property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* You can use {@link #hasEqualsValue()} to see if a value was sent in this field.
* </p>
*
* @return The value of the Equals property for this object.
*/
public final Map<String, String> equalsValue() {
return equalsValue;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class<? extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
hashCode = 31 * hashCode + Objects.hashCode(build());
hashCode = 31 * hashCode + Objects.hashCode(superValue());
hashCode = 31 * hashCode + Objects.hashCode(toStringValue());
hashCode = 31 * hashCode + Objects.hashCode(equalsValue());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof ExistenceCheckNamingResponse)) {
return false;
}
ExistenceCheckNamingResponse other = (ExistenceCheckNamingResponse) obj;
return Objects.equals(build(), other.build()) && Objects.equals(superValue(), other.superValue())
&& Objects.equals(toStringValue(), other.toStringValue()) && Objects.equals(equalsValue(), other.equalsValue());
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("ExistenceCheckNamingResponse").add("Build", build()).add("Super", superValue())
.add("ToString", toStringValue()).add("Equals", equalsValue()).build();
}
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
switch (fieldName) {
case "Build":
return Optional.ofNullable(clazz.cast(build()));
case "super":
return Optional.ofNullable(clazz.cast(superValue()));
case "toString":
return Optional.ofNullable(clazz.cast(toStringValue()));
case "equals":
return Optional.ofNullable(clazz.cast(equalsValue()));
default:
return Optional.empty();
}
}
@Override
public final List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
private static <T> Function<Object, T> getter(Function<ExistenceCheckNamingResponse, T> g) {
return obj -> g.apply((ExistenceCheckNamingResponse) obj);
}
private static <T> BiConsumer<Object, T> setter(BiConsumer<Builder, T> s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
public interface Builder extends JsonProtocolTestsResponse.Builder, SdkPojo,
CopyableBuilder<Builder, ExistenceCheckNamingResponse> {
/**
* Sets the value of the Build property for this object.
*
* @param build
* The new value for the Build property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder build(Collection<String> build);
/**
* Sets the value of the Build property for this object.
*
* @param build
* The new value for the Build property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder build(String... build);
/**
* Sets the value of the Super property for this object.
*
* @param superValue
* The new value for the Super property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder superValue(Collection<String> superValue);
/**
* Sets the value of the Super property for this object.
*
* @param superValue
* The new value for the Super property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder superValue(String... superValue);
/**
* Sets the value of the ToString property for this object.
*
* @param toStringValue
* The new value for the ToString property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder toStringValue(Map<String, String> toStringValue);
/**
* Sets the value of the Equals property for this object.
*
* @param equalsValue
* The new value for the Equals property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder equalsValue(Map<String, String> equalsValue);
}
static final class BuilderImpl extends JsonProtocolTestsResponse.BuilderImpl implements Builder {
private List<String> build;
private List<String> superValue;
private Map<String, String> toStringValue;
private Map<String, String> equalsValue;
private BuilderImpl() {
}
private BuilderImpl(ExistenceCheckNamingResponse model) {
super(model);
build(model.build);
superValue(model.superValue);
toStringValue(model.toStringValue);
equalsValue(model.equalsValue);
}
public final Collection<String> getBuild() {
return build;
}
@Override
public final Builder build(Collection<String> build) {
this.build = ListOfStringsCopier.copy(build);
return this;
}
@Override
@SafeVarargs
public final Builder build(String... build) {
build(Arrays.asList(build));
return this;
}
public final void setBuild(Collection<String> build) {
this.build = ListOfStringsCopier.copy(build);
}
public final Collection<String> getSuperValue() {
return superValue;
}
@Override
public final Builder superValue(Collection<String> superValue) {
this.superValue = ListOfStringsCopier.copy(superValue);
return this;
}
@Override
@SafeVarargs
public final Builder superValue(String... superValue) {
superValue(Arrays.asList(superValue));
return this;
}
public final void setSuperValue(Collection<String> superValue) {
this.superValue = ListOfStringsCopier.copy(superValue);
}
public final Map<String, String> getToStringValue() {
return toStringValue;
}
@Override
public final Builder toStringValue(Map<String, String> toStringValue) {
this.toStringValue = MapOfStringToStringCopier.copy(toStringValue);
return this;
}
public final void setToStringValue(Map<String, String> toStringValue) {
this.toStringValue = MapOfStringToStringCopier.copy(toStringValue);
}
public final Map<String, String> getEqualsValue() {
return equalsValue;
}
@Override
public final Builder equalsValue(Map<String, String> equalsValue) {
this.equalsValue = MapOfStringToStringCopier.copy(equalsValue);
return this;
}
public final void setEqualsValue(Map<String, String> equalsValue) {
this.equalsValue = MapOfStringToStringCopier.copy(equalsValue);
}
@Override
public ExistenceCheckNamingResponse build() {
return new ExistenceCheckNamingResponse(this);
}
@Override
public List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
}
}
| 3,480 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/nonautoconstructcontainers/nestedcontainersresponse.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
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.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.traits.MapTrait;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class NestedContainersResponse extends JsonProtocolTestsResponse implements
ToCopyableBuilder<NestedContainersResponse.Builder, NestedContainersResponse> {
private static final SdkField<List<List<String>>> LIST_OF_LIST_OF_STRINGS_FIELD = SdkField
.<List<List<String>>> builder(MarshallingType.LIST)
.memberName("ListOfListOfStrings")
.getter(getter(NestedContainersResponse::listOfListOfStrings))
.setter(setter(Builder::listOfListOfStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ListOfListOfStrings").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<List<String>> builder(MarshallingType.LIST)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder()
.location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build())
.build()).build()).build()).build();
private static final SdkField<List<List<List<String>>>> LIST_OF_LIST_OF_LIST_OF_STRINGS_FIELD = SdkField
.<List<List<List<String>>>> builder(MarshallingType.LIST)
.memberName("ListOfListOfListOfStrings")
.getter(getter(NestedContainersResponse::listOfListOfListOfStrings))
.setter(setter(Builder::listOfListOfListOfStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ListOfListOfListOfStrings").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<List<List<String>>> builder(MarshallingType.LIST)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<List<String>> builder(MarshallingType.LIST)
.traits(LocationTrait.builder()
.location(MarshallLocation.PAYLOAD)
.locationName("member").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<String> builder(
MarshallingType.STRING)
.traits(LocationTrait
.builder()
.location(
MarshallLocation.PAYLOAD)
.locationName(
"member")
.build())
.build()).build())
.build()).build()).build()).build()).build();
private static final SdkField<Map<String, List<List<String>>>> MAP_OF_STRING_TO_LIST_OF_LIST_OF_STRINGS_FIELD = SdkField
.<Map<String, List<List<String>>>> builder(MarshallingType.MAP)
.memberName("MapOfStringToListOfListOfStrings")
.getter(getter(NestedContainersResponse::mapOfStringToListOfListOfStrings))
.setter(setter(Builder::mapOfStringToListOfListOfStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MapOfStringToListOfListOfStrings")
.build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<List<List<String>>> builder(MarshallingType.LIST)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<List<String>> builder(MarshallingType.LIST)
.traits(LocationTrait.builder()
.location(MarshallLocation.PAYLOAD)
.locationName("member").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<String> builder(
MarshallingType.STRING)
.traits(LocationTrait
.builder()
.location(
MarshallLocation.PAYLOAD)
.locationName(
"member")
.build())
.build()).build())
.build()).build()).build()).build()).build();
private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(LIST_OF_LIST_OF_STRINGS_FIELD,
LIST_OF_LIST_OF_LIST_OF_STRINGS_FIELD, MAP_OF_STRING_TO_LIST_OF_LIST_OF_STRINGS_FIELD));
private final List<List<String>> listOfListOfStrings;
private final List<List<List<String>>> listOfListOfListOfStrings;
private final Map<String, List<List<String>>> mapOfStringToListOfListOfStrings;
private NestedContainersResponse(BuilderImpl builder) {
super(builder);
this.listOfListOfStrings = builder.listOfListOfStrings;
this.listOfListOfListOfStrings = builder.listOfListOfListOfStrings;
this.mapOfStringToListOfListOfStrings = builder.mapOfStringToListOfListOfStrings;
}
/**
* Returns true if the ListOfListOfStrings property was specified by the sender (it may be empty), or false if the
* sender did not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS
* service.
*/
public final boolean hasListOfListOfStrings() {
return listOfListOfStrings != null && !(listOfListOfStrings instanceof SdkAutoConstructList);
}
/**
* Returns the value of the ListOfListOfStrings property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* You can use {@link #hasListOfListOfStrings()} to see if a value was sent in this field.
* </p>
*
* @return The value of the ListOfListOfStrings property for this object.
*/
public final List<List<String>> listOfListOfStrings() {
return listOfListOfStrings;
}
/**
* Returns true if the ListOfListOfListOfStrings property was specified by the sender (it may be empty), or false if
* the sender did not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS
* service.
*/
public final boolean hasListOfListOfListOfStrings() {
return listOfListOfListOfStrings != null && !(listOfListOfListOfStrings instanceof SdkAutoConstructList);
}
/**
* Returns the value of the ListOfListOfListOfStrings property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* You can use {@link #hasListOfListOfListOfStrings()} to see if a value was sent in this field.
* </p>
*
* @return The value of the ListOfListOfListOfStrings property for this object.
*/
public final List<List<List<String>>> listOfListOfListOfStrings() {
return listOfListOfListOfStrings;
}
/**
* Returns true if the MapOfStringToListOfListOfStrings property was specified by the sender (it may be empty), or
* false if the sender did not specify the value (it will be empty). For responses returned by the SDK, the sender
* is the AWS service.
*/
public final boolean hasMapOfStringToListOfListOfStrings() {
return mapOfStringToListOfListOfStrings != null && !(mapOfStringToListOfListOfStrings instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the MapOfStringToListOfListOfStrings property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* You can use {@link #hasMapOfStringToListOfListOfStrings()} to see if a value was sent in this field.
* </p>
*
* @return The value of the MapOfStringToListOfListOfStrings property for this object.
*/
public final Map<String, List<List<String>>> mapOfStringToListOfListOfStrings() {
return mapOfStringToListOfListOfStrings;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class<? extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
hashCode = 31 * hashCode + Objects.hashCode(listOfListOfStrings());
hashCode = 31 * hashCode + Objects.hashCode(listOfListOfListOfStrings());
hashCode = 31 * hashCode + Objects.hashCode(mapOfStringToListOfListOfStrings());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof NestedContainersResponse)) {
return false;
}
NestedContainersResponse other = (NestedContainersResponse) obj;
return Objects.equals(listOfListOfStrings(), other.listOfListOfStrings())
&& Objects.equals(listOfListOfListOfStrings(), other.listOfListOfListOfStrings())
&& Objects.equals(mapOfStringToListOfListOfStrings(), other.mapOfStringToListOfListOfStrings());
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("NestedContainersResponse").add("ListOfListOfStrings", listOfListOfStrings())
.add("ListOfListOfListOfStrings", listOfListOfListOfStrings())
.add("MapOfStringToListOfListOfStrings", mapOfStringToListOfListOfStrings()).build();
}
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
switch (fieldName) {
case "ListOfListOfStrings":
return Optional.ofNullable(clazz.cast(listOfListOfStrings()));
case "ListOfListOfListOfStrings":
return Optional.ofNullable(clazz.cast(listOfListOfListOfStrings()));
case "MapOfStringToListOfListOfStrings":
return Optional.ofNullable(clazz.cast(mapOfStringToListOfListOfStrings()));
default:
return Optional.empty();
}
}
@Override
public final List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
private static <T> Function<Object, T> getter(Function<NestedContainersResponse, T> g) {
return obj -> g.apply((NestedContainersResponse) obj);
}
private static <T> BiConsumer<Object, T> setter(BiConsumer<Builder, T> s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
public interface Builder extends JsonProtocolTestsResponse.Builder, SdkPojo,
CopyableBuilder<Builder, NestedContainersResponse> {
/**
* Sets the value of the ListOfListOfStrings property for this object.
*
* @param listOfListOfStrings
* The new value for the ListOfListOfStrings property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfListOfStrings(Collection<? extends Collection<String>> listOfListOfStrings);
/**
* Sets the value of the ListOfListOfStrings property for this object.
*
* @param listOfListOfStrings
* The new value for the ListOfListOfStrings property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfListOfStrings(Collection<String>... listOfListOfStrings);
/**
* Sets the value of the ListOfListOfListOfStrings property for this object.
*
* @param listOfListOfListOfStrings
* The new value for the ListOfListOfListOfStrings property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfListOfListOfStrings(Collection<? extends Collection<? extends Collection<String>>> listOfListOfListOfStrings);
/**
* Sets the value of the ListOfListOfListOfStrings property for this object.
*
* @param listOfListOfListOfStrings
* The new value for the ListOfListOfListOfStrings property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfListOfListOfStrings(Collection<? extends Collection<String>>... listOfListOfListOfStrings);
/**
* Sets the value of the MapOfStringToListOfListOfStrings property for this object.
*
* @param mapOfStringToListOfListOfStrings
* The new value for the MapOfStringToListOfListOfStrings property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfStringToListOfListOfStrings(
Map<String, ? extends Collection<? extends Collection<String>>> mapOfStringToListOfListOfStrings);
}
static final class BuilderImpl extends JsonProtocolTestsResponse.BuilderImpl implements Builder {
private List<List<String>> listOfListOfStrings;
private List<List<List<String>>> listOfListOfListOfStrings;
private Map<String, List<List<String>>> mapOfStringToListOfListOfStrings;
private BuilderImpl() {
}
private BuilderImpl(NestedContainersResponse model) {
super(model);
listOfListOfStrings(model.listOfListOfStrings);
listOfListOfListOfStrings(model.listOfListOfListOfStrings);
mapOfStringToListOfListOfStrings(model.mapOfStringToListOfListOfStrings);
}
public final Collection<? extends Collection<String>> getListOfListOfStrings() {
return listOfListOfStrings;
}
@Override
public final Builder listOfListOfStrings(Collection<? extends Collection<String>> listOfListOfStrings) {
this.listOfListOfStrings = ListOfListOfStringsCopier.copy(listOfListOfStrings);
return this;
}
@Override
@SafeVarargs
public final Builder listOfListOfStrings(Collection<String>... listOfListOfStrings) {
listOfListOfStrings(Arrays.asList(listOfListOfStrings));
return this;
}
public final void setListOfListOfStrings(Collection<? extends Collection<String>> listOfListOfStrings) {
this.listOfListOfStrings = ListOfListOfStringsCopier.copy(listOfListOfStrings);
}
public final Collection<? extends Collection<? extends Collection<String>>> getListOfListOfListOfStrings() {
return listOfListOfListOfStrings;
}
@Override
public final Builder listOfListOfListOfStrings(
Collection<? extends Collection<? extends Collection<String>>> listOfListOfListOfStrings) {
this.listOfListOfListOfStrings = ListOfListOfListOfStringsCopier.copy(listOfListOfListOfStrings);
return this;
}
@Override
@SafeVarargs
public final Builder listOfListOfListOfStrings(Collection<? extends Collection<String>>... listOfListOfListOfStrings) {
listOfListOfListOfStrings(Arrays.asList(listOfListOfListOfStrings));
return this;
}
public final void setListOfListOfListOfStrings(
Collection<? extends Collection<? extends Collection<String>>> listOfListOfListOfStrings) {
this.listOfListOfListOfStrings = ListOfListOfListOfStringsCopier.copy(listOfListOfListOfStrings);
}
public final Map<String, ? extends Collection<? extends Collection<String>>> getMapOfStringToListOfListOfStrings() {
return mapOfStringToListOfListOfStrings;
}
@Override
public final Builder mapOfStringToListOfListOfStrings(
Map<String, ? extends Collection<? extends Collection<String>>> mapOfStringToListOfListOfStrings) {
this.mapOfStringToListOfListOfStrings = MapOfStringToListOfListOfStringsCopier.copy(mapOfStringToListOfListOfStrings);
return this;
}
public final void setMapOfStringToListOfListOfStrings(
Map<String, ? extends Collection<? extends Collection<String>>> mapOfStringToListOfListOfStrings) {
this.mapOfStringToListOfListOfStrings = MapOfStringToListOfListOfStringsCopier.copy(mapOfStringToListOfListOfStrings);
}
@Override
public NestedContainersResponse build() {
return new NestedContainersResponse(this);
}
@Override
public List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
}
}
| 3,481 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/nonautoconstructcontainers/recursivestructtype.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import software.amazon.awssdk.annotations.Generated;
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.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.traits.MapTrait;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
import software.amazon.awssdk.utils.CollectionUtils;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class RecursiveStructType implements SdkPojo, Serializable,
ToCopyableBuilder<RecursiveStructType.Builder, RecursiveStructType> {
private static final SdkField<String> NO_RECURSE_FIELD = SdkField.<String> builder(MarshallingType.STRING)
.memberName("NoRecurse").getter(getter(RecursiveStructType::noRecurse)).setter(setter(Builder::noRecurse))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("NoRecurse").build()).build();
private static final SdkField<RecursiveStructType> RECURSIVE_STRUCT_FIELD = SdkField
.<RecursiveStructType> builder(MarshallingType.SDK_POJO).memberName("RecursiveStruct")
.getter(getter(RecursiveStructType::recursiveStruct)).setter(setter(Builder::recursiveStruct))
.constructor(RecursiveStructType::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RecursiveStruct").build()).build();
private static final SdkField<List<RecursiveStructType>> RECURSIVE_LIST_FIELD = SdkField
.<List<RecursiveStructType>> builder(MarshallingType.LIST)
.memberName("RecursiveList")
.getter(getter(RecursiveStructType::recursiveList))
.setter(setter(Builder::recursiveList))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RecursiveList").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<RecursiveStructType> builder(MarshallingType.SDK_POJO)
.constructor(RecursiveStructType::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField<Map<String, RecursiveStructType>> RECURSIVE_MAP_FIELD = SdkField
.<Map<String, RecursiveStructType>> builder(MarshallingType.MAP)
.memberName("RecursiveMap")
.getter(getter(RecursiveStructType::recursiveMap))
.setter(setter(Builder::recursiveMap))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RecursiveMap").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<RecursiveStructType> builder(MarshallingType.SDK_POJO)
.constructor(RecursiveStructType::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build()).build()).build();
private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(NO_RECURSE_FIELD,
RECURSIVE_STRUCT_FIELD, RECURSIVE_LIST_FIELD, RECURSIVE_MAP_FIELD));
private static final long serialVersionUID = 1L;
private final String noRecurse;
private final RecursiveStructType recursiveStruct;
private final List<RecursiveStructType> recursiveList;
private final Map<String, RecursiveStructType> recursiveMap;
private RecursiveStructType(BuilderImpl builder) {
this.noRecurse = builder.noRecurse;
this.recursiveStruct = builder.recursiveStruct;
this.recursiveList = builder.recursiveList;
this.recursiveMap = builder.recursiveMap;
}
/**
* Returns the value of the NoRecurse property for this object.
*
* @return The value of the NoRecurse property for this object.
*/
public final String noRecurse() {
return noRecurse;
}
/**
* Returns the value of the RecursiveStruct property for this object.
*
* @return The value of the RecursiveStruct property for this object.
*/
public final RecursiveStructType recursiveStruct() {
return recursiveStruct;
}
/**
* Returns true if the RecursiveList property was specified by the sender (it may be empty), or false if the sender
* did not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS service.
*/
public final boolean hasRecursiveList() {
return recursiveList != null && !(recursiveList instanceof SdkAutoConstructList);
}
/**
* Returns the value of the RecursiveList property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* You can use {@link #hasRecursiveList()} to see if a value was sent in this field.
* </p>
*
* @return The value of the RecursiveList property for this object.
*/
public final List<RecursiveStructType> recursiveList() {
return recursiveList;
}
/**
* Returns true if the RecursiveMap property was specified by the sender (it may be empty), or false if the sender
* did not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS service.
*/
public final boolean hasRecursiveMap() {
return recursiveMap != null && !(recursiveMap instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the RecursiveMap property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* You can use {@link #hasRecursiveMap()} to see if a value was sent in this field.
* </p>
*
* @return The value of the RecursiveMap property for this object.
*/
public final Map<String, RecursiveStructType> recursiveMap() {
return recursiveMap;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class<? extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(noRecurse());
hashCode = 31 * hashCode + Objects.hashCode(recursiveStruct());
hashCode = 31 * hashCode + Objects.hashCode(recursiveList());
hashCode = 31 * hashCode + Objects.hashCode(recursiveMap());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof RecursiveStructType)) {
return false;
}
RecursiveStructType other = (RecursiveStructType) obj;
return Objects.equals(noRecurse(), other.noRecurse()) && Objects.equals(recursiveStruct(), other.recursiveStruct())
&& Objects.equals(recursiveList(), other.recursiveList()) && Objects.equals(recursiveMap(), other.recursiveMap());
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("RecursiveStructType").add("NoRecurse", noRecurse()).add("RecursiveStruct", recursiveStruct())
.add("RecursiveList", recursiveList()).add("RecursiveMap", recursiveMap()).build();
}
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
switch (fieldName) {
case "NoRecurse":
return Optional.ofNullable(clazz.cast(noRecurse()));
case "RecursiveStruct":
return Optional.ofNullable(clazz.cast(recursiveStruct()));
case "RecursiveList":
return Optional.ofNullable(clazz.cast(recursiveList()));
case "RecursiveMap":
return Optional.ofNullable(clazz.cast(recursiveMap()));
default:
return Optional.empty();
}
}
@Override
public final List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
private static <T> Function<Object, T> getter(Function<RecursiveStructType, T> g) {
return obj -> g.apply((RecursiveStructType) obj);
}
private static <T> BiConsumer<Object, T> setter(BiConsumer<Builder, T> s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
public interface Builder extends SdkPojo, CopyableBuilder<Builder, RecursiveStructType> {
/**
* Sets the value of the NoRecurse property for this object.
*
* @param noRecurse
* The new value for the NoRecurse property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder noRecurse(String noRecurse);
/**
* Sets the value of the RecursiveStruct property for this object.
*
* @param recursiveStruct
* The new value for the RecursiveStruct property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder recursiveStruct(RecursiveStructType recursiveStruct);
/**
* Sets the value of the RecursiveStruct property for this object.
*
* This is a convenience that creates an instance of the {@link RecursiveStructType.Builder} avoiding the need
* to create one manually via {@link RecursiveStructType#builder()}.
*
* When the {@link Consumer} completes, {@link RecursiveStructType.Builder#build()} is called immediately and
* its result is passed to {@link #recursiveStruct(RecursiveStructType)}.
*
* @param recursiveStruct
* a consumer that will call methods on {@link RecursiveStructType.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #recursiveStruct(RecursiveStructType)
*/
default Builder recursiveStruct(Consumer<Builder> recursiveStruct) {
return recursiveStruct(RecursiveStructType.builder().applyMutation(recursiveStruct).build());
}
/**
* Sets the value of the RecursiveList property for this object.
*
* @param recursiveList
* The new value for the RecursiveList property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder recursiveList(Collection<RecursiveStructType> recursiveList);
/**
* Sets the value of the RecursiveList property for this object.
*
* @param recursiveList
* The new value for the RecursiveList property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder recursiveList(RecursiveStructType... recursiveList);
/**
* Sets the value of the RecursiveList property for this object.
*
* This is a convenience that creates an instance of the {@link List<RecursiveStructType>.Builder} avoiding the
* need to create one manually via {@link List<RecursiveStructType>#builder()}.
*
* When the {@link Consumer} completes, {@link List<RecursiveStructType>.Builder#build()} is called immediately
* and its result is passed to {@link #recursiveList(List<RecursiveStructType>)}.
*
* @param recursiveList
* a consumer that will call methods on {@link List<RecursiveStructType>.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #recursiveList(List<RecursiveStructType>)
*/
Builder recursiveList(Consumer<Builder>... recursiveList);
/**
* Sets the value of the RecursiveMap property for this object.
*
* @param recursiveMap
* The new value for the RecursiveMap property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder recursiveMap(Map<String, RecursiveStructType> recursiveMap);
}
static final class BuilderImpl implements Builder {
private String noRecurse;
private RecursiveStructType recursiveStruct;
private List<RecursiveStructType> recursiveList;
private Map<String, RecursiveStructType> recursiveMap;
private BuilderImpl() {
}
private BuilderImpl(RecursiveStructType model) {
noRecurse(model.noRecurse);
recursiveStruct(model.recursiveStruct);
recursiveList(model.recursiveList);
recursiveMap(model.recursiveMap);
}
public final String getNoRecurse() {
return noRecurse;
}
@Override
public final Builder noRecurse(String noRecurse) {
this.noRecurse = noRecurse;
return this;
}
public final void setNoRecurse(String noRecurse) {
this.noRecurse = noRecurse;
}
public final Builder getRecursiveStruct() {
return recursiveStruct != null ? recursiveStruct.toBuilder() : null;
}
@Override
public final Builder recursiveStruct(RecursiveStructType recursiveStruct) {
this.recursiveStruct = recursiveStruct;
return this;
}
public final void setRecursiveStruct(BuilderImpl recursiveStruct) {
this.recursiveStruct = recursiveStruct != null ? recursiveStruct.build() : null;
}
public final Collection<Builder> getRecursiveList() {
return recursiveList != null ? recursiveList.stream().map(RecursiveStructType::toBuilder)
.collect(Collectors.toList()) : null;
}
@Override
public final Builder recursiveList(Collection<RecursiveStructType> recursiveList) {
this.recursiveList = RecursiveListTypeCopier.copy(recursiveList);
return this;
}
@Override
@SafeVarargs
public final Builder recursiveList(RecursiveStructType... recursiveList) {
recursiveList(Arrays.asList(recursiveList));
return this;
}
@Override
@SafeVarargs
public final Builder recursiveList(Consumer<Builder>... recursiveList) {
recursiveList(Stream.of(recursiveList).map(c -> RecursiveStructType.builder().applyMutation(c).build())
.collect(Collectors.toList()));
return this;
}
public final void setRecursiveList(Collection<BuilderImpl> recursiveList) {
this.recursiveList = RecursiveListTypeCopier.copyFromBuilder(recursiveList);
}
public final Map<String, Builder> getRecursiveMap() {
return recursiveMap != null ? CollectionUtils.mapValues(recursiveMap, RecursiveStructType::toBuilder) : null;
}
@Override
public final Builder recursiveMap(Map<String, RecursiveStructType> recursiveMap) {
this.recursiveMap = RecursiveMapTypeCopier.copy(recursiveMap);
return this;
}
public final void setRecursiveMap(Map<String, BuilderImpl> recursiveMap) {
this.recursiveMap = RecursiveMapTypeCopier.copyFromBuilder(recursiveMap);
}
@Override
public RecursiveStructType build() {
return new RecursiveStructType(this);
}
@Override
public List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
}
}
| 3,482 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/nonautoconstructcontainers/nestedcontainersrequest.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
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.AwsRequestOverrideConfiguration;
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.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.traits.MapTrait;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class NestedContainersRequest extends JsonProtocolTestsRequest implements
ToCopyableBuilder<NestedContainersRequest.Builder, NestedContainersRequest> {
private static final SdkField<List<List<String>>> LIST_OF_LIST_OF_STRINGS_FIELD = SdkField
.<List<List<String>>> builder(MarshallingType.LIST)
.memberName("ListOfListOfStrings")
.getter(getter(NestedContainersRequest::listOfListOfStrings))
.setter(setter(Builder::listOfListOfStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ListOfListOfStrings").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<List<String>> builder(MarshallingType.LIST)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder()
.location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build())
.build()).build()).build()).build();
private static final SdkField<List<List<List<String>>>> LIST_OF_LIST_OF_LIST_OF_STRINGS_FIELD = SdkField
.<List<List<List<String>>>> builder(MarshallingType.LIST)
.memberName("ListOfListOfListOfStrings")
.getter(getter(NestedContainersRequest::listOfListOfListOfStrings))
.setter(setter(Builder::listOfListOfListOfStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ListOfListOfListOfStrings").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<List<List<String>>> builder(MarshallingType.LIST)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<List<String>> builder(MarshallingType.LIST)
.traits(LocationTrait.builder()
.location(MarshallLocation.PAYLOAD)
.locationName("member").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<String> builder(
MarshallingType.STRING)
.traits(LocationTrait
.builder()
.location(
MarshallLocation.PAYLOAD)
.locationName(
"member")
.build())
.build()).build())
.build()).build()).build()).build()).build();
private static final SdkField<Map<String, List<List<String>>>> MAP_OF_STRING_TO_LIST_OF_LIST_OF_STRINGS_FIELD = SdkField
.<Map<String, List<List<String>>>> builder(MarshallingType.MAP)
.memberName("MapOfStringToListOfListOfStrings")
.getter(getter(NestedContainersRequest::mapOfStringToListOfListOfStrings))
.setter(setter(Builder::mapOfStringToListOfListOfStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MapOfStringToListOfListOfStrings")
.build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<List<List<String>>> builder(MarshallingType.LIST)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<List<String>> builder(MarshallingType.LIST)
.traits(LocationTrait.builder()
.location(MarshallLocation.PAYLOAD)
.locationName("member").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<String> builder(
MarshallingType.STRING)
.traits(LocationTrait
.builder()
.location(
MarshallLocation.PAYLOAD)
.locationName(
"member")
.build())
.build()).build())
.build()).build()).build()).build()).build();
private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(LIST_OF_LIST_OF_STRINGS_FIELD,
LIST_OF_LIST_OF_LIST_OF_STRINGS_FIELD, MAP_OF_STRING_TO_LIST_OF_LIST_OF_STRINGS_FIELD));
private final List<List<String>> listOfListOfStrings;
private final List<List<List<String>>> listOfListOfListOfStrings;
private final Map<String, List<List<String>>> mapOfStringToListOfListOfStrings;
private NestedContainersRequest(BuilderImpl builder) {
super(builder);
this.listOfListOfStrings = builder.listOfListOfStrings;
this.listOfListOfListOfStrings = builder.listOfListOfListOfStrings;
this.mapOfStringToListOfListOfStrings = builder.mapOfStringToListOfListOfStrings;
}
/**
* Returns true if the ListOfListOfStrings property was specified by the sender (it may be empty), or false if the
* sender did not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS
* service.
*/
public final boolean hasListOfListOfStrings() {
return listOfListOfStrings != null && !(listOfListOfStrings instanceof SdkAutoConstructList);
}
/**
* Returns the value of the ListOfListOfStrings property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* You can use {@link #hasListOfListOfStrings()} to see if a value was sent in this field.
* </p>
*
* @return The value of the ListOfListOfStrings property for this object.
*/
public final List<List<String>> listOfListOfStrings() {
return listOfListOfStrings;
}
/**
* Returns true if the ListOfListOfListOfStrings property was specified by the sender (it may be empty), or false if
* the sender did not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS
* service.
*/
public final boolean hasListOfListOfListOfStrings() {
return listOfListOfListOfStrings != null && !(listOfListOfListOfStrings instanceof SdkAutoConstructList);
}
/**
* Returns the value of the ListOfListOfListOfStrings property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* You can use {@link #hasListOfListOfListOfStrings()} to see if a value was sent in this field.
* </p>
*
* @return The value of the ListOfListOfListOfStrings property for this object.
*/
public final List<List<List<String>>> listOfListOfListOfStrings() {
return listOfListOfListOfStrings;
}
/**
* Returns true if the MapOfStringToListOfListOfStrings property was specified by the sender (it may be empty), or
* false if the sender did not specify the value (it will be empty). For responses returned by the SDK, the sender
* is the AWS service.
*/
public final boolean hasMapOfStringToListOfListOfStrings() {
return mapOfStringToListOfListOfStrings != null && !(mapOfStringToListOfListOfStrings instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the MapOfStringToListOfListOfStrings property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* You can use {@link #hasMapOfStringToListOfListOfStrings()} to see if a value was sent in this field.
* </p>
*
* @return The value of the MapOfStringToListOfListOfStrings property for this object.
*/
public final Map<String, List<List<String>>> mapOfStringToListOfListOfStrings() {
return mapOfStringToListOfListOfStrings;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class<? extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
hashCode = 31 * hashCode + Objects.hashCode(listOfListOfStrings());
hashCode = 31 * hashCode + Objects.hashCode(listOfListOfListOfStrings());
hashCode = 31 * hashCode + Objects.hashCode(mapOfStringToListOfListOfStrings());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof NestedContainersRequest)) {
return false;
}
NestedContainersRequest other = (NestedContainersRequest) obj;
return Objects.equals(listOfListOfStrings(), other.listOfListOfStrings())
&& Objects.equals(listOfListOfListOfStrings(), other.listOfListOfListOfStrings())
&& Objects.equals(mapOfStringToListOfListOfStrings(), other.mapOfStringToListOfListOfStrings());
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("NestedContainersRequest").add("ListOfListOfStrings", listOfListOfStrings())
.add("ListOfListOfListOfStrings", listOfListOfListOfStrings())
.add("MapOfStringToListOfListOfStrings", mapOfStringToListOfListOfStrings()).build();
}
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
switch (fieldName) {
case "ListOfListOfStrings":
return Optional.ofNullable(clazz.cast(listOfListOfStrings()));
case "ListOfListOfListOfStrings":
return Optional.ofNullable(clazz.cast(listOfListOfListOfStrings()));
case "MapOfStringToListOfListOfStrings":
return Optional.ofNullable(clazz.cast(mapOfStringToListOfListOfStrings()));
default:
return Optional.empty();
}
}
@Override
public final List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
private static <T> Function<Object, T> getter(Function<NestedContainersRequest, T> g) {
return obj -> g.apply((NestedContainersRequest) obj);
}
private static <T> BiConsumer<Object, T> setter(BiConsumer<Builder, T> s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
public interface Builder extends JsonProtocolTestsRequest.Builder, SdkPojo, CopyableBuilder<Builder, NestedContainersRequest> {
/**
* Sets the value of the ListOfListOfStrings property for this object.
*
* @param listOfListOfStrings
* The new value for the ListOfListOfStrings property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfListOfStrings(Collection<? extends Collection<String>> listOfListOfStrings);
/**
* Sets the value of the ListOfListOfStrings property for this object.
*
* @param listOfListOfStrings
* The new value for the ListOfListOfStrings property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfListOfStrings(Collection<String>... listOfListOfStrings);
/**
* Sets the value of the ListOfListOfListOfStrings property for this object.
*
* @param listOfListOfListOfStrings
* The new value for the ListOfListOfListOfStrings property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfListOfListOfStrings(Collection<? extends Collection<? extends Collection<String>>> listOfListOfListOfStrings);
/**
* Sets the value of the ListOfListOfListOfStrings property for this object.
*
* @param listOfListOfListOfStrings
* The new value for the ListOfListOfListOfStrings property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfListOfListOfStrings(Collection<? extends Collection<String>>... listOfListOfListOfStrings);
/**
* Sets the value of the MapOfStringToListOfListOfStrings property for this object.
*
* @param mapOfStringToListOfListOfStrings
* The new value for the MapOfStringToListOfListOfStrings property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfStringToListOfListOfStrings(
Map<String, ? extends Collection<? extends Collection<String>>> mapOfStringToListOfListOfStrings);
@Override
Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration);
@Override
Builder overrideConfiguration(Consumer<AwsRequestOverrideConfiguration.Builder> builderConsumer);
}
static final class BuilderImpl extends JsonProtocolTestsRequest.BuilderImpl implements Builder {
private List<List<String>> listOfListOfStrings;
private List<List<List<String>>> listOfListOfListOfStrings;
private Map<String, List<List<String>>> mapOfStringToListOfListOfStrings;
private BuilderImpl() {
}
private BuilderImpl(NestedContainersRequest model) {
super(model);
listOfListOfStrings(model.listOfListOfStrings);
listOfListOfListOfStrings(model.listOfListOfListOfStrings);
mapOfStringToListOfListOfStrings(model.mapOfStringToListOfListOfStrings);
}
public final Collection<? extends Collection<String>> getListOfListOfStrings() {
return listOfListOfStrings;
}
@Override
public final Builder listOfListOfStrings(Collection<? extends Collection<String>> listOfListOfStrings) {
this.listOfListOfStrings = ListOfListOfStringsCopier.copy(listOfListOfStrings);
return this;
}
@Override
@SafeVarargs
public final Builder listOfListOfStrings(Collection<String>... listOfListOfStrings) {
listOfListOfStrings(Arrays.asList(listOfListOfStrings));
return this;
}
public final void setListOfListOfStrings(Collection<? extends Collection<String>> listOfListOfStrings) {
this.listOfListOfStrings = ListOfListOfStringsCopier.copy(listOfListOfStrings);
}
public final Collection<? extends Collection<? extends Collection<String>>> getListOfListOfListOfStrings() {
return listOfListOfListOfStrings;
}
@Override
public final Builder listOfListOfListOfStrings(
Collection<? extends Collection<? extends Collection<String>>> listOfListOfListOfStrings) {
this.listOfListOfListOfStrings = ListOfListOfListOfStringsCopier.copy(listOfListOfListOfStrings);
return this;
}
@Override
@SafeVarargs
public final Builder listOfListOfListOfStrings(Collection<? extends Collection<String>>... listOfListOfListOfStrings) {
listOfListOfListOfStrings(Arrays.asList(listOfListOfListOfStrings));
return this;
}
public final void setListOfListOfListOfStrings(
Collection<? extends Collection<? extends Collection<String>>> listOfListOfListOfStrings) {
this.listOfListOfListOfStrings = ListOfListOfListOfStringsCopier.copy(listOfListOfListOfStrings);
}
public final Map<String, ? extends Collection<? extends Collection<String>>> getMapOfStringToListOfListOfStrings() {
return mapOfStringToListOfListOfStrings;
}
@Override
public final Builder mapOfStringToListOfListOfStrings(
Map<String, ? extends Collection<? extends Collection<String>>> mapOfStringToListOfListOfStrings) {
this.mapOfStringToListOfListOfStrings = MapOfStringToListOfListOfStringsCopier.copy(mapOfStringToListOfListOfStrings);
return this;
}
public final void setMapOfStringToListOfListOfStrings(
Map<String, ? extends Collection<? extends Collection<String>>> mapOfStringToListOfListOfStrings) {
this.mapOfStringToListOfListOfStrings = MapOfStringToListOfListOfStringsCopier.copy(mapOfStringToListOfListOfStrings);
}
@Override
public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) {
super.overrideConfiguration(overrideConfiguration);
return this;
}
@Override
public Builder overrideConfiguration(Consumer<AwsRequestOverrideConfiguration.Builder> builderConsumer) {
super.overrideConfiguration(builderConsumer);
return this;
}
@Override
public NestedContainersRequest build() {
return new NestedContainersRequest(this);
}
@Override
public List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
}
}
| 3,483 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/nonautoconstructcontainers/alltypesresponse.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import java.nio.ByteBuffer;
import java.time.Instant;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkBytes;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.adapter.StandardMemberCopier;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.traits.MapTrait;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
import software.amazon.awssdk.utils.CollectionUtils;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class AllTypesResponse extends JsonProtocolTestsResponse implements
ToCopyableBuilder<AllTypesResponse.Builder, AllTypesResponse> {
private static final SdkField<String> STRING_MEMBER_FIELD = SdkField.<String> builder(MarshallingType.STRING)
.memberName("StringMember").getter(getter(AllTypesResponse::stringMember)).setter(setter(Builder::stringMember))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StringMember").build()).build();
private static final SdkField<Integer> INTEGER_MEMBER_FIELD = SdkField.<Integer> builder(MarshallingType.INTEGER)
.memberName("IntegerMember").getter(getter(AllTypesResponse::integerMember)).setter(setter(Builder::integerMember))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("IntegerMember").build()).build();
private static final SdkField<Boolean> BOOLEAN_MEMBER_FIELD = SdkField.<Boolean> builder(MarshallingType.BOOLEAN)
.memberName("BooleanMember").getter(getter(AllTypesResponse::booleanMember)).setter(setter(Builder::booleanMember))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("BooleanMember").build()).build();
private static final SdkField<Float> FLOAT_MEMBER_FIELD = SdkField.<Float> builder(MarshallingType.FLOAT)
.memberName("FloatMember").getter(getter(AllTypesResponse::floatMember)).setter(setter(Builder::floatMember))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("FloatMember").build()).build();
private static final SdkField<Double> DOUBLE_MEMBER_FIELD = SdkField.<Double> builder(MarshallingType.DOUBLE)
.memberName("DoubleMember").getter(getter(AllTypesResponse::doubleMember)).setter(setter(Builder::doubleMember))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DoubleMember").build()).build();
private static final SdkField<Long> LONG_MEMBER_FIELD = SdkField.<Long> builder(MarshallingType.LONG)
.memberName("LongMember").getter(getter(AllTypesResponse::longMember)).setter(setter(Builder::longMember))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LongMember").build()).build();
private static final SdkField<List<String>> SIMPLE_LIST_FIELD = SdkField
.<List<String>> builder(MarshallingType.LIST)
.memberName("SimpleList")
.getter(getter(AllTypesResponse::simpleList))
.setter(setter(Builder::simpleList))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SimpleList").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField<List<String>> LIST_OF_ENUMS_FIELD = SdkField
.<List<String>> builder(MarshallingType.LIST)
.memberName("ListOfEnums")
.getter(getter(AllTypesResponse::listOfEnumsAsStrings))
.setter(setter(Builder::listOfEnumsWithStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ListOfEnums").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField<List<Map<String, String>>> LIST_OF_MAPS_FIELD = SdkField
.<List<Map<String, String>>> builder(MarshallingType.LIST)
.memberName("ListOfMaps")
.getter(getter(AllTypesResponse::listOfMaps))
.setter(setter(Builder::listOfMaps))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ListOfMaps").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<Map<String, String>> builder(MarshallingType.MAP)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder()
.location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build())
.build()).build()).build()).build();
private static final SdkField<List<SimpleStruct>> LIST_OF_STRUCTS_FIELD = SdkField
.<List<SimpleStruct>> builder(MarshallingType.LIST)
.memberName("ListOfStructs")
.getter(getter(AllTypesResponse::listOfStructs))
.setter(setter(Builder::listOfStructs))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ListOfStructs").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<SimpleStruct> builder(MarshallingType.SDK_POJO)
.constructor(SimpleStruct::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField<List<Map<String, String>>> LIST_OF_MAP_OF_ENUM_TO_STRING_FIELD = SdkField
.<List<Map<String, String>>> builder(MarshallingType.LIST)
.memberName("ListOfMapOfEnumToString")
.getter(getter(AllTypesResponse::listOfMapOfEnumToStringAsStrings))
.setter(setter(Builder::listOfMapOfEnumToStringWithStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ListOfMapOfEnumToString").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<Map<String, String>> builder(MarshallingType.MAP)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder()
.location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build())
.build()).build()).build()).build();
private static final SdkField<Map<String, List<Integer>>> MAP_OF_STRING_TO_INTEGER_LIST_FIELD = SdkField
.<Map<String, List<Integer>>> builder(MarshallingType.MAP)
.memberName("MapOfStringToIntegerList")
.getter(getter(AllTypesResponse::mapOfStringToIntegerList))
.setter(setter(Builder::mapOfStringToIntegerList))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MapOfStringToIntegerList").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<List<Integer>> builder(MarshallingType.LIST)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<Integer> builder(MarshallingType.INTEGER)
.traits(LocationTrait.builder()
.location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build())
.build()).build()).build()).build();
private static final SdkField<Map<String, String>> MAP_OF_STRING_TO_STRING_FIELD = SdkField
.<Map<String, String>> builder(MarshallingType.MAP)
.memberName("MapOfStringToString")
.getter(getter(AllTypesResponse::mapOfStringToString))
.setter(setter(Builder::mapOfStringToString))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MapOfStringToString").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build()).build()).build();
private static final SdkField<Map<String, SimpleStruct>> MAP_OF_STRING_TO_SIMPLE_STRUCT_FIELD = SdkField
.<Map<String, SimpleStruct>> builder(MarshallingType.MAP)
.memberName("MapOfStringToSimpleStruct")
.getter(getter(AllTypesResponse::mapOfStringToSimpleStruct))
.setter(setter(Builder::mapOfStringToSimpleStruct))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MapOfStringToSimpleStruct").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<SimpleStruct> builder(MarshallingType.SDK_POJO)
.constructor(SimpleStruct::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build()).build()).build();
private static final SdkField<Map<String, String>> MAP_OF_ENUM_TO_ENUM_FIELD = SdkField
.<Map<String, String>> builder(MarshallingType.MAP)
.memberName("MapOfEnumToEnum")
.getter(getter(AllTypesResponse::mapOfEnumToEnumAsStrings))
.setter(setter(Builder::mapOfEnumToEnumWithStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MapOfEnumToEnum").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build()).build()).build();
private static final SdkField<Map<String, String>> MAP_OF_ENUM_TO_STRING_FIELD = SdkField
.<Map<String, String>> builder(MarshallingType.MAP)
.memberName("MapOfEnumToString")
.getter(getter(AllTypesResponse::mapOfEnumToStringAsStrings))
.setter(setter(Builder::mapOfEnumToStringWithStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MapOfEnumToString").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build()).build()).build();
private static final SdkField<Map<String, String>> MAP_OF_STRING_TO_ENUM_FIELD = SdkField
.<Map<String, String>> builder(MarshallingType.MAP)
.memberName("MapOfStringToEnum")
.getter(getter(AllTypesResponse::mapOfStringToEnumAsStrings))
.setter(setter(Builder::mapOfStringToEnumWithStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MapOfStringToEnum").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build()).build()).build();
private static final SdkField<Map<String, SimpleStruct>> MAP_OF_ENUM_TO_SIMPLE_STRUCT_FIELD = SdkField
.<Map<String, SimpleStruct>> builder(MarshallingType.MAP)
.memberName("MapOfEnumToSimpleStruct")
.getter(getter(AllTypesResponse::mapOfEnumToSimpleStructAsStrings))
.setter(setter(Builder::mapOfEnumToSimpleStructWithStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MapOfEnumToSimpleStruct").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<SimpleStruct> builder(MarshallingType.SDK_POJO)
.constructor(SimpleStruct::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build()).build()).build();
private static final SdkField<Map<String, List<String>>> MAP_OF_ENUM_TO_LIST_OF_ENUMS_FIELD = SdkField
.<Map<String, List<String>>> builder(MarshallingType.MAP)
.memberName("MapOfEnumToListOfEnums")
.getter(getter(AllTypesResponse::mapOfEnumToListOfEnumsAsStrings))
.setter(setter(Builder::mapOfEnumToListOfEnumsWithStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MapOfEnumToListOfEnums").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<List<String>> builder(MarshallingType.LIST)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder()
.location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build())
.build()).build()).build()).build();
private static final SdkField<Map<String, Map<String, String>>> MAP_OF_ENUM_TO_MAP_OF_STRING_TO_ENUM_FIELD = SdkField
.<Map<String, Map<String, String>>> builder(MarshallingType.MAP)
.memberName("MapOfEnumToMapOfStringToEnum")
.getter(getter(AllTypesResponse::mapOfEnumToMapOfStringToEnumAsStrings))
.setter(setter(Builder::mapOfEnumToMapOfStringToEnumWithStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MapOfEnumToMapOfStringToEnum")
.build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<Map<String, String>> builder(MarshallingType.MAP)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder()
.location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build())
.build()).build()).build()).build();
private static final SdkField<Instant> TIMESTAMP_MEMBER_FIELD = SdkField.<Instant> builder(MarshallingType.INSTANT)
.memberName("TimestampMember").getter(getter(AllTypesResponse::timestampMember))
.setter(setter(Builder::timestampMember))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TimestampMember").build()).build();
private static final SdkField<StructWithTimestamp> STRUCT_WITH_NESTED_TIMESTAMP_MEMBER_FIELD = SdkField
.<StructWithTimestamp> builder(MarshallingType.SDK_POJO)
.memberName("StructWithNestedTimestampMember")
.getter(getter(AllTypesResponse::structWithNestedTimestampMember))
.setter(setter(Builder::structWithNestedTimestampMember))
.constructor(StructWithTimestamp::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StructWithNestedTimestampMember")
.build()).build();
private static final SdkField<SdkBytes> BLOB_ARG_FIELD = SdkField.<SdkBytes> builder(MarshallingType.SDK_BYTES)
.memberName("BlobArg").getter(getter(AllTypesResponse::blobArg)).setter(setter(Builder::blobArg))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("BlobArg").build()).build();
private static final SdkField<StructWithNestedBlobType> STRUCT_WITH_NESTED_BLOB_FIELD = SdkField
.<StructWithNestedBlobType> builder(MarshallingType.SDK_POJO).memberName("StructWithNestedBlob")
.getter(getter(AllTypesResponse::structWithNestedBlob)).setter(setter(Builder::structWithNestedBlob))
.constructor(StructWithNestedBlobType::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StructWithNestedBlob").build())
.build();
private static final SdkField<Map<String, SdkBytes>> BLOB_MAP_FIELD = SdkField
.<Map<String, SdkBytes>> builder(MarshallingType.MAP)
.memberName("BlobMap")
.getter(getter(AllTypesResponse::blobMap))
.setter(setter(Builder::blobMap))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("BlobMap").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<SdkBytes> builder(MarshallingType.SDK_BYTES)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build()).build()).build();
private static final SdkField<List<SdkBytes>> LIST_OF_BLOBS_FIELD = SdkField
.<List<SdkBytes>> builder(MarshallingType.LIST)
.memberName("ListOfBlobs")
.getter(getter(AllTypesResponse::listOfBlobs))
.setter(setter(Builder::listOfBlobs))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ListOfBlobs").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<SdkBytes> builder(MarshallingType.SDK_BYTES)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField<RecursiveStructType> RECURSIVE_STRUCT_FIELD = SdkField
.<RecursiveStructType> builder(MarshallingType.SDK_POJO).memberName("RecursiveStruct")
.getter(getter(AllTypesResponse::recursiveStruct)).setter(setter(Builder::recursiveStruct))
.constructor(RecursiveStructType::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RecursiveStruct").build()).build();
private static final SdkField<BaseType> POLYMORPHIC_TYPE_WITH_SUB_TYPES_FIELD = SdkField
.<BaseType> builder(MarshallingType.SDK_POJO)
.memberName("PolymorphicTypeWithSubTypes")
.getter(getter(AllTypesResponse::polymorphicTypeWithSubTypes))
.setter(setter(Builder::polymorphicTypeWithSubTypes))
.constructor(BaseType::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("PolymorphicTypeWithSubTypes")
.build()).build();
private static final SdkField<SubTypeOne> POLYMORPHIC_TYPE_WITHOUT_SUB_TYPES_FIELD = SdkField
.<SubTypeOne> builder(MarshallingType.SDK_POJO)
.memberName("PolymorphicTypeWithoutSubTypes")
.getter(getter(AllTypesResponse::polymorphicTypeWithoutSubTypes))
.setter(setter(Builder::polymorphicTypeWithoutSubTypes))
.constructor(SubTypeOne::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("PolymorphicTypeWithoutSubTypes")
.build()).build();
private static final SdkField<String> ENUM_TYPE_FIELD = SdkField.<String> builder(MarshallingType.STRING)
.memberName("EnumType").getter(getter(AllTypesResponse::enumTypeAsString)).setter(setter(Builder::enumType))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EnumType").build()).build();
private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(STRING_MEMBER_FIELD,
INTEGER_MEMBER_FIELD, BOOLEAN_MEMBER_FIELD, FLOAT_MEMBER_FIELD, DOUBLE_MEMBER_FIELD, LONG_MEMBER_FIELD,
SIMPLE_LIST_FIELD, LIST_OF_ENUMS_FIELD, LIST_OF_MAPS_FIELD, LIST_OF_STRUCTS_FIELD,
LIST_OF_MAP_OF_ENUM_TO_STRING_FIELD, MAP_OF_STRING_TO_INTEGER_LIST_FIELD, MAP_OF_STRING_TO_STRING_FIELD,
MAP_OF_STRING_TO_SIMPLE_STRUCT_FIELD, MAP_OF_ENUM_TO_ENUM_FIELD, MAP_OF_ENUM_TO_STRING_FIELD,
MAP_OF_STRING_TO_ENUM_FIELD, MAP_OF_ENUM_TO_SIMPLE_STRUCT_FIELD, MAP_OF_ENUM_TO_LIST_OF_ENUMS_FIELD,
MAP_OF_ENUM_TO_MAP_OF_STRING_TO_ENUM_FIELD, TIMESTAMP_MEMBER_FIELD, STRUCT_WITH_NESTED_TIMESTAMP_MEMBER_FIELD,
BLOB_ARG_FIELD, STRUCT_WITH_NESTED_BLOB_FIELD, BLOB_MAP_FIELD, LIST_OF_BLOBS_FIELD, RECURSIVE_STRUCT_FIELD,
POLYMORPHIC_TYPE_WITH_SUB_TYPES_FIELD, POLYMORPHIC_TYPE_WITHOUT_SUB_TYPES_FIELD, ENUM_TYPE_FIELD));
private final String stringMember;
private final Integer integerMember;
private final Boolean booleanMember;
private final Float floatMember;
private final Double doubleMember;
private final Long longMember;
private final List<String> simpleList;
private final List<String> listOfEnums;
private final List<Map<String, String>> listOfMaps;
private final List<SimpleStruct> listOfStructs;
private final List<Map<String, String>> listOfMapOfEnumToString;
private final Map<String, List<Integer>> mapOfStringToIntegerList;
private final Map<String, String> mapOfStringToString;
private final Map<String, SimpleStruct> mapOfStringToSimpleStruct;
private final Map<String, String> mapOfEnumToEnum;
private final Map<String, String> mapOfEnumToString;
private final Map<String, String> mapOfStringToEnum;
private final Map<String, SimpleStruct> mapOfEnumToSimpleStruct;
private final Map<String, List<String>> mapOfEnumToListOfEnums;
private final Map<String, Map<String, String>> mapOfEnumToMapOfStringToEnum;
private final Instant timestampMember;
private final StructWithTimestamp structWithNestedTimestampMember;
private final SdkBytes blobArg;
private final StructWithNestedBlobType structWithNestedBlob;
private final Map<String, SdkBytes> blobMap;
private final List<SdkBytes> listOfBlobs;
private final RecursiveStructType recursiveStruct;
private final BaseType polymorphicTypeWithSubTypes;
private final SubTypeOne polymorphicTypeWithoutSubTypes;
private final String enumType;
private AllTypesResponse(BuilderImpl builder) {
super(builder);
this.stringMember = builder.stringMember;
this.integerMember = builder.integerMember;
this.booleanMember = builder.booleanMember;
this.floatMember = builder.floatMember;
this.doubleMember = builder.doubleMember;
this.longMember = builder.longMember;
this.simpleList = builder.simpleList;
this.listOfEnums = builder.listOfEnums;
this.listOfMaps = builder.listOfMaps;
this.listOfStructs = builder.listOfStructs;
this.listOfMapOfEnumToString = builder.listOfMapOfEnumToString;
this.mapOfStringToIntegerList = builder.mapOfStringToIntegerList;
this.mapOfStringToString = builder.mapOfStringToString;
this.mapOfStringToSimpleStruct = builder.mapOfStringToSimpleStruct;
this.mapOfEnumToEnum = builder.mapOfEnumToEnum;
this.mapOfEnumToString = builder.mapOfEnumToString;
this.mapOfStringToEnum = builder.mapOfStringToEnum;
this.mapOfEnumToSimpleStruct = builder.mapOfEnumToSimpleStruct;
this.mapOfEnumToListOfEnums = builder.mapOfEnumToListOfEnums;
this.mapOfEnumToMapOfStringToEnum = builder.mapOfEnumToMapOfStringToEnum;
this.timestampMember = builder.timestampMember;
this.structWithNestedTimestampMember = builder.structWithNestedTimestampMember;
this.blobArg = builder.blobArg;
this.structWithNestedBlob = builder.structWithNestedBlob;
this.blobMap = builder.blobMap;
this.listOfBlobs = builder.listOfBlobs;
this.recursiveStruct = builder.recursiveStruct;
this.polymorphicTypeWithSubTypes = builder.polymorphicTypeWithSubTypes;
this.polymorphicTypeWithoutSubTypes = builder.polymorphicTypeWithoutSubTypes;
this.enumType = builder.enumType;
}
/**
* Returns the value of the StringMember property for this object.
*
* @return The value of the StringMember property for this object.
*/
public final String stringMember() {
return stringMember;
}
/**
* Returns the value of the IntegerMember property for this object.
*
* @return The value of the IntegerMember property for this object.
*/
public final Integer integerMember() {
return integerMember;
}
/**
* Returns the value of the BooleanMember property for this object.
*
* @return The value of the BooleanMember property for this object.
*/
public final Boolean booleanMember() {
return booleanMember;
}
/**
* Returns the value of the FloatMember property for this object.
*
* @return The value of the FloatMember property for this object.
*/
public final Float floatMember() {
return floatMember;
}
/**
* Returns the value of the DoubleMember property for this object.
*
* @return The value of the DoubleMember property for this object.
*/
public final Double doubleMember() {
return doubleMember;
}
/**
* Returns the value of the LongMember property for this object.
*
* @return The value of the LongMember property for this object.
*/
public final Long longMember() {
return longMember;
}
/**
* Returns true if the SimpleList property was specified by the sender (it may be empty), or false if the sender did
* not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS service.
*/
public final boolean hasSimpleList() {
return simpleList != null && !(simpleList instanceof SdkAutoConstructList);
}
/**
* Returns the value of the SimpleList property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* You can use {@link #hasSimpleList()} to see if a value was sent in this field.
* </p>
*
* @return The value of the SimpleList property for this object.
*/
public final List<String> simpleList() {
return simpleList;
}
/**
* Returns the value of the ListOfEnums property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* You can use {@link #hasListOfEnums()} to see if a value was sent in this field.
* </p>
*
* @return The value of the ListOfEnums property for this object.
*/
public final List<EnumType> listOfEnums() {
return ListOfEnumsCopier.copyStringToEnum(listOfEnums);
}
/**
* Returns true if the ListOfEnums property was specified by the sender (it may be empty), or false if the sender
* did not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS service.
*/
public final boolean hasListOfEnums() {
return listOfEnums != null && !(listOfEnums instanceof SdkAutoConstructList);
}
/**
* Returns the value of the ListOfEnums property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* You can use {@link #hasListOfEnums()} to see if a value was sent in this field.
* </p>
*
* @return The value of the ListOfEnums property for this object.
*/
public final List<String> listOfEnumsAsStrings() {
return listOfEnums;
}
/**
* Returns true if the ListOfMaps property was specified by the sender (it may be empty), or false if the sender did
* not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS service.
*/
public final boolean hasListOfMaps() {
return listOfMaps != null && !(listOfMaps instanceof SdkAutoConstructList);
}
/**
* Returns the value of the ListOfMaps property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* You can use {@link #hasListOfMaps()} to see if a value was sent in this field.
* </p>
*
* @return The value of the ListOfMaps property for this object.
*/
public final List<Map<String, String>> listOfMaps() {
return listOfMaps;
}
/**
* Returns true if the ListOfStructs property was specified by the sender (it may be empty), or false if the sender
* did not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS service.
*/
public final boolean hasListOfStructs() {
return listOfStructs != null && !(listOfStructs instanceof SdkAutoConstructList);
}
/**
* Returns the value of the ListOfStructs property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* You can use {@link #hasListOfStructs()} to see if a value was sent in this field.
* </p>
*
* @return The value of the ListOfStructs property for this object.
*/
public final List<SimpleStruct> listOfStructs() {
return listOfStructs;
}
/**
* Returns the value of the ListOfMapOfEnumToString property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* You can use {@link #hasListOfMapOfEnumToString()} to see if a value was sent in this field.
* </p>
*
* @return The value of the ListOfMapOfEnumToString property for this object.
*/
public final List<Map<EnumType, String>> listOfMapOfEnumToString() {
return ListOfMapOfEnumToStringCopier.copyStringToEnum(listOfMapOfEnumToString);
}
/**
* Returns true if the ListOfMapOfEnumToString property was specified by the sender (it may be empty), or false if
* the sender did not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS
* service.
*/
public final boolean hasListOfMapOfEnumToString() {
return listOfMapOfEnumToString != null && !(listOfMapOfEnumToString instanceof SdkAutoConstructList);
}
/**
* Returns the value of the ListOfMapOfEnumToString property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* You can use {@link #hasListOfMapOfEnumToString()} to see if a value was sent in this field.
* </p>
*
* @return The value of the ListOfMapOfEnumToString property for this object.
*/
public final List<Map<String, String>> listOfMapOfEnumToStringAsStrings() {
return listOfMapOfEnumToString;
}
/**
* Returns true if the MapOfStringToIntegerList property was specified by the sender (it may be empty), or false if
* the sender did not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS
* service.
*/
public final boolean hasMapOfStringToIntegerList() {
return mapOfStringToIntegerList != null && !(mapOfStringToIntegerList instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the MapOfStringToIntegerList property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* You can use {@link #hasMapOfStringToIntegerList()} to see if a value was sent in this field.
* </p>
*
* @return The value of the MapOfStringToIntegerList property for this object.
*/
public final Map<String, List<Integer>> mapOfStringToIntegerList() {
return mapOfStringToIntegerList;
}
/**
* Returns true if the MapOfStringToString property was specified by the sender (it may be empty), or false if the
* sender did not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS
* service.
*/
public final boolean hasMapOfStringToString() {
return mapOfStringToString != null && !(mapOfStringToString instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the MapOfStringToString property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* You can use {@link #hasMapOfStringToString()} to see if a value was sent in this field.
* </p>
*
* @return The value of the MapOfStringToString property for this object.
*/
public final Map<String, String> mapOfStringToString() {
return mapOfStringToString;
}
/**
* Returns true if the MapOfStringToSimpleStruct property was specified by the sender (it may be empty), or false if
* the sender did not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS
* service.
*/
public final boolean hasMapOfStringToSimpleStruct() {
return mapOfStringToSimpleStruct != null && !(mapOfStringToSimpleStruct instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the MapOfStringToSimpleStruct property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* You can use {@link #hasMapOfStringToSimpleStruct()} to see if a value was sent in this field.
* </p>
*
* @return The value of the MapOfStringToSimpleStruct property for this object.
*/
public final Map<String, SimpleStruct> mapOfStringToSimpleStruct() {
return mapOfStringToSimpleStruct;
}
/**
* Returns the value of the MapOfEnumToEnum property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* You can use {@link #hasMapOfEnumToEnum()} to see if a value was sent in this field.
* </p>
*
* @return The value of the MapOfEnumToEnum property for this object.
*/
public final Map<EnumType, EnumType> mapOfEnumToEnum() {
return MapOfEnumToEnumCopier.copyStringToEnum(mapOfEnumToEnum);
}
/**
* Returns true if the MapOfEnumToEnum property was specified by the sender (it may be empty), or false if the
* sender did not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS
* service.
*/
public final boolean hasMapOfEnumToEnum() {
return mapOfEnumToEnum != null && !(mapOfEnumToEnum instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the MapOfEnumToEnum property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* You can use {@link #hasMapOfEnumToEnum()} to see if a value was sent in this field.
* </p>
*
* @return The value of the MapOfEnumToEnum property for this object.
*/
public final Map<String, String> mapOfEnumToEnumAsStrings() {
return mapOfEnumToEnum;
}
/**
* Returns the value of the MapOfEnumToString property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* You can use {@link #hasMapOfEnumToString()} to see if a value was sent in this field.
* </p>
*
* @return The value of the MapOfEnumToString property for this object.
*/
public final Map<EnumType, String> mapOfEnumToString() {
return MapOfEnumToStringCopier.copyStringToEnum(mapOfEnumToString);
}
/**
* Returns true if the MapOfEnumToString property was specified by the sender (it may be empty), or false if the
* sender did not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS
* service.
*/
public final boolean hasMapOfEnumToString() {
return mapOfEnumToString != null && !(mapOfEnumToString instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the MapOfEnumToString property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* You can use {@link #hasMapOfEnumToString()} to see if a value was sent in this field.
* </p>
*
* @return The value of the MapOfEnumToString property for this object.
*/
public final Map<String, String> mapOfEnumToStringAsStrings() {
return mapOfEnumToString;
}
/**
* Returns the value of the MapOfStringToEnum property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* You can use {@link #hasMapOfStringToEnum()} to see if a value was sent in this field.
* </p>
*
* @return The value of the MapOfStringToEnum property for this object.
*/
public final Map<String, EnumType> mapOfStringToEnum() {
return MapOfStringToEnumCopier.copyStringToEnum(mapOfStringToEnum);
}
/**
* Returns true if the MapOfStringToEnum property was specified by the sender (it may be empty), or false if the
* sender did not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS
* service.
*/
public final boolean hasMapOfStringToEnum() {
return mapOfStringToEnum != null && !(mapOfStringToEnum instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the MapOfStringToEnum property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* You can use {@link #hasMapOfStringToEnum()} to see if a value was sent in this field.
* </p>
*
* @return The value of the MapOfStringToEnum property for this object.
*/
public final Map<String, String> mapOfStringToEnumAsStrings() {
return mapOfStringToEnum;
}
/**
* Returns the value of the MapOfEnumToSimpleStruct property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* You can use {@link #hasMapOfEnumToSimpleStruct()} to see if a value was sent in this field.
* </p>
*
* @return The value of the MapOfEnumToSimpleStruct property for this object.
*/
public final Map<EnumType, SimpleStruct> mapOfEnumToSimpleStruct() {
return MapOfEnumToSimpleStructCopier.copyStringToEnum(mapOfEnumToSimpleStruct);
}
/**
* Returns true if the MapOfEnumToSimpleStruct property was specified by the sender (it may be empty), or false if
* the sender did not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS
* service.
*/
public final boolean hasMapOfEnumToSimpleStruct() {
return mapOfEnumToSimpleStruct != null && !(mapOfEnumToSimpleStruct instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the MapOfEnumToSimpleStruct property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* You can use {@link #hasMapOfEnumToSimpleStruct()} to see if a value was sent in this field.
* </p>
*
* @return The value of the MapOfEnumToSimpleStruct property for this object.
*/
public final Map<String, SimpleStruct> mapOfEnumToSimpleStructAsStrings() {
return mapOfEnumToSimpleStruct;
}
/**
* Returns the value of the MapOfEnumToListOfEnums property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* You can use {@link #hasMapOfEnumToListOfEnums()} to see if a value was sent in this field.
* </p>
*
* @return The value of the MapOfEnumToListOfEnums property for this object.
*/
public final Map<EnumType, List<EnumType>> mapOfEnumToListOfEnums() {
return MapOfEnumToListOfEnumsCopier.copyStringToEnum(mapOfEnumToListOfEnums);
}
/**
* Returns true if the MapOfEnumToListOfEnums property was specified by the sender (it may be empty), or false if
* the sender did not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS
* service.
*/
public final boolean hasMapOfEnumToListOfEnums() {
return mapOfEnumToListOfEnums != null && !(mapOfEnumToListOfEnums instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the MapOfEnumToListOfEnums property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* You can use {@link #hasMapOfEnumToListOfEnums()} to see if a value was sent in this field.
* </p>
*
* @return The value of the MapOfEnumToListOfEnums property for this object.
*/
public final Map<String, List<String>> mapOfEnumToListOfEnumsAsStrings() {
return mapOfEnumToListOfEnums;
}
/**
* Returns the value of the MapOfEnumToMapOfStringToEnum property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* You can use {@link #hasMapOfEnumToMapOfStringToEnum()} to see if a value was sent in this field.
* </p>
*
* @return The value of the MapOfEnumToMapOfStringToEnum property for this object.
*/
public final Map<EnumType, Map<String, EnumType>> mapOfEnumToMapOfStringToEnum() {
return MapOfEnumToMapOfStringToEnumCopier.copyStringToEnum(mapOfEnumToMapOfStringToEnum);
}
/**
* Returns true if the MapOfEnumToMapOfStringToEnum property was specified by the sender (it may be empty), or false
* if the sender did not specify the value (it will be empty). For responses returned by the SDK, the sender is the
* AWS service.
*/
public final boolean hasMapOfEnumToMapOfStringToEnum() {
return mapOfEnumToMapOfStringToEnum != null && !(mapOfEnumToMapOfStringToEnum instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the MapOfEnumToMapOfStringToEnum property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* You can use {@link #hasMapOfEnumToMapOfStringToEnum()} to see if a value was sent in this field.
* </p>
*
* @return The value of the MapOfEnumToMapOfStringToEnum property for this object.
*/
public final Map<String, Map<String, String>> mapOfEnumToMapOfStringToEnumAsStrings() {
return mapOfEnumToMapOfStringToEnum;
}
/**
* Returns the value of the TimestampMember property for this object.
*
* @return The value of the TimestampMember property for this object.
*/
public final Instant timestampMember() {
return timestampMember;
}
/**
* Returns the value of the StructWithNestedTimestampMember property for this object.
*
* @return The value of the StructWithNestedTimestampMember property for this object.
*/
public final StructWithTimestamp structWithNestedTimestampMember() {
return structWithNestedTimestampMember;
}
/**
* Returns the value of the BlobArg property for this object.
*
* @return The value of the BlobArg property for this object.
*/
public final SdkBytes blobArg() {
return blobArg;
}
/**
* Returns the value of the StructWithNestedBlob property for this object.
*
* @return The value of the StructWithNestedBlob property for this object.
*/
public final StructWithNestedBlobType structWithNestedBlob() {
return structWithNestedBlob;
}
/**
* Returns true if the BlobMap property was specified by the sender (it may be empty), or false if the sender did
* not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS service.
*/
public final boolean hasBlobMap() {
return blobMap != null && !(blobMap instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the BlobMap property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* You can use {@link #hasBlobMap()} to see if a value was sent in this field.
* </p>
*
* @return The value of the BlobMap property for this object.
*/
public final Map<String, SdkBytes> blobMap() {
return blobMap;
}
/**
* Returns true if the ListOfBlobs property was specified by the sender (it may be empty), or false if the sender
* did not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS service.
*/
public final boolean hasListOfBlobs() {
return listOfBlobs != null && !(listOfBlobs instanceof SdkAutoConstructList);
}
/**
* Returns the value of the ListOfBlobs property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* You can use {@link #hasListOfBlobs()} to see if a value was sent in this field.
* </p>
*
* @return The value of the ListOfBlobs property for this object.
*/
public final List<SdkBytes> listOfBlobs() {
return listOfBlobs;
}
/**
* Returns the value of the RecursiveStruct property for this object.
*
* @return The value of the RecursiveStruct property for this object.
*/
public final RecursiveStructType recursiveStruct() {
return recursiveStruct;
}
/**
* Returns the value of the PolymorphicTypeWithSubTypes property for this object.
*
* @return The value of the PolymorphicTypeWithSubTypes property for this object.
*/
public final BaseType polymorphicTypeWithSubTypes() {
return polymorphicTypeWithSubTypes;
}
/**
* Returns the value of the PolymorphicTypeWithoutSubTypes property for this object.
*
* @return The value of the PolymorphicTypeWithoutSubTypes property for this object.
*/
public final SubTypeOne polymorphicTypeWithoutSubTypes() {
return polymorphicTypeWithoutSubTypes;
}
/**
* Returns the value of the EnumType property for this object.
* <p>
* If the service returns an enum value that is not available in the current SDK version, {@link #enumType} will
* return {@link EnumType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #enumTypeAsString}.
* </p>
*
* @return The value of the EnumType property for this object.
* @see EnumType
*/
public final EnumType enumType() {
return EnumType.fromValue(enumType);
}
/**
* Returns the value of the EnumType property for this object.
* <p>
* If the service returns an enum value that is not available in the current SDK version, {@link #enumType} will
* return {@link EnumType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #enumTypeAsString}.
* </p>
*
* @return The value of the EnumType property for this object.
* @see EnumType
*/
public final String enumTypeAsString() {
return enumType;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class<? extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
hashCode = 31 * hashCode + Objects.hashCode(stringMember());
hashCode = 31 * hashCode + Objects.hashCode(integerMember());
hashCode = 31 * hashCode + Objects.hashCode(booleanMember());
hashCode = 31 * hashCode + Objects.hashCode(floatMember());
hashCode = 31 * hashCode + Objects.hashCode(doubleMember());
hashCode = 31 * hashCode + Objects.hashCode(longMember());
hashCode = 31 * hashCode + Objects.hashCode(simpleList());
hashCode = 31 * hashCode + Objects.hashCode(listOfEnumsAsStrings());
hashCode = 31 * hashCode + Objects.hashCode(listOfMaps());
hashCode = 31 * hashCode + Objects.hashCode(listOfStructs());
hashCode = 31 * hashCode + Objects.hashCode(listOfMapOfEnumToStringAsStrings());
hashCode = 31 * hashCode + Objects.hashCode(mapOfStringToIntegerList());
hashCode = 31 * hashCode + Objects.hashCode(mapOfStringToString());
hashCode = 31 * hashCode + Objects.hashCode(mapOfStringToSimpleStruct());
hashCode = 31 * hashCode + Objects.hashCode(mapOfEnumToEnumAsStrings());
hashCode = 31 * hashCode + Objects.hashCode(mapOfEnumToStringAsStrings());
hashCode = 31 * hashCode + Objects.hashCode(mapOfStringToEnumAsStrings());
hashCode = 31 * hashCode + Objects.hashCode(mapOfEnumToSimpleStructAsStrings());
hashCode = 31 * hashCode + Objects.hashCode(mapOfEnumToListOfEnumsAsStrings());
hashCode = 31 * hashCode + Objects.hashCode(mapOfEnumToMapOfStringToEnumAsStrings());
hashCode = 31 * hashCode + Objects.hashCode(timestampMember());
hashCode = 31 * hashCode + Objects.hashCode(structWithNestedTimestampMember());
hashCode = 31 * hashCode + Objects.hashCode(blobArg());
hashCode = 31 * hashCode + Objects.hashCode(structWithNestedBlob());
hashCode = 31 * hashCode + Objects.hashCode(blobMap());
hashCode = 31 * hashCode + Objects.hashCode(listOfBlobs());
hashCode = 31 * hashCode + Objects.hashCode(recursiveStruct());
hashCode = 31 * hashCode + Objects.hashCode(polymorphicTypeWithSubTypes());
hashCode = 31 * hashCode + Objects.hashCode(polymorphicTypeWithoutSubTypes());
hashCode = 31 * hashCode + Objects.hashCode(enumTypeAsString());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof AllTypesResponse)) {
return false;
}
AllTypesResponse other = (AllTypesResponse) obj;
return Objects.equals(stringMember(), other.stringMember()) && Objects.equals(integerMember(), other.integerMember())
&& Objects.equals(booleanMember(), other.booleanMember()) && Objects.equals(floatMember(), other.floatMember())
&& Objects.equals(doubleMember(), other.doubleMember()) && Objects.equals(longMember(), other.longMember())
&& Objects.equals(simpleList(), other.simpleList())
&& Objects.equals(listOfEnumsAsStrings(), other.listOfEnumsAsStrings())
&& Objects.equals(listOfMaps(), other.listOfMaps()) && Objects.equals(listOfStructs(), other.listOfStructs())
&& Objects.equals(listOfMapOfEnumToStringAsStrings(), other.listOfMapOfEnumToStringAsStrings())
&& Objects.equals(mapOfStringToIntegerList(), other.mapOfStringToIntegerList())
&& Objects.equals(mapOfStringToString(), other.mapOfStringToString())
&& Objects.equals(mapOfStringToSimpleStruct(), other.mapOfStringToSimpleStruct())
&& Objects.equals(mapOfEnumToEnumAsStrings(), other.mapOfEnumToEnumAsStrings())
&& Objects.equals(mapOfEnumToStringAsStrings(), other.mapOfEnumToStringAsStrings())
&& Objects.equals(mapOfStringToEnumAsStrings(), other.mapOfStringToEnumAsStrings())
&& Objects.equals(mapOfEnumToSimpleStructAsStrings(), other.mapOfEnumToSimpleStructAsStrings())
&& Objects.equals(mapOfEnumToListOfEnumsAsStrings(), other.mapOfEnumToListOfEnumsAsStrings())
&& Objects.equals(mapOfEnumToMapOfStringToEnumAsStrings(), other.mapOfEnumToMapOfStringToEnumAsStrings())
&& Objects.equals(timestampMember(), other.timestampMember())
&& Objects.equals(structWithNestedTimestampMember(), other.structWithNestedTimestampMember())
&& Objects.equals(blobArg(), other.blobArg())
&& Objects.equals(structWithNestedBlob(), other.structWithNestedBlob())
&& Objects.equals(blobMap(), other.blobMap()) && Objects.equals(listOfBlobs(), other.listOfBlobs())
&& Objects.equals(recursiveStruct(), other.recursiveStruct())
&& Objects.equals(polymorphicTypeWithSubTypes(), other.polymorphicTypeWithSubTypes())
&& Objects.equals(polymorphicTypeWithoutSubTypes(), other.polymorphicTypeWithoutSubTypes())
&& Objects.equals(enumTypeAsString(), other.enumTypeAsString());
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("AllTypesResponse").add("StringMember", stringMember()).add("IntegerMember", integerMember())
.add("BooleanMember", booleanMember()).add("FloatMember", floatMember()).add("DoubleMember", doubleMember())
.add("LongMember", longMember()).add("SimpleList", simpleList()).add("ListOfEnums", listOfEnumsAsStrings())
.add("ListOfMaps", listOfMaps()).add("ListOfStructs", listOfStructs())
.add("ListOfMapOfEnumToString", listOfMapOfEnumToStringAsStrings())
.add("MapOfStringToIntegerList", mapOfStringToIntegerList()).add("MapOfStringToString", mapOfStringToString())
.add("MapOfStringToSimpleStruct", mapOfStringToSimpleStruct()).add("MapOfEnumToEnum", mapOfEnumToEnumAsStrings())
.add("MapOfEnumToString", mapOfEnumToStringAsStrings()).add("MapOfStringToEnum", mapOfStringToEnumAsStrings())
.add("MapOfEnumToSimpleStruct", mapOfEnumToSimpleStructAsStrings())
.add("MapOfEnumToListOfEnums", mapOfEnumToListOfEnumsAsStrings())
.add("MapOfEnumToMapOfStringToEnum", mapOfEnumToMapOfStringToEnumAsStrings())
.add("TimestampMember", timestampMember())
.add("StructWithNestedTimestampMember", structWithNestedTimestampMember()).add("BlobArg", blobArg())
.add("StructWithNestedBlob", structWithNestedBlob()).add("BlobMap", blobMap()).add("ListOfBlobs", listOfBlobs())
.add("RecursiveStruct", recursiveStruct()).add("PolymorphicTypeWithSubTypes", polymorphicTypeWithSubTypes())
.add("PolymorphicTypeWithoutSubTypes", polymorphicTypeWithoutSubTypes()).add("EnumType", enumTypeAsString())
.build();
}
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
switch (fieldName) {
case "StringMember":
return Optional.ofNullable(clazz.cast(stringMember()));
case "IntegerMember":
return Optional.ofNullable(clazz.cast(integerMember()));
case "BooleanMember":
return Optional.ofNullable(clazz.cast(booleanMember()));
case "FloatMember":
return Optional.ofNullable(clazz.cast(floatMember()));
case "DoubleMember":
return Optional.ofNullable(clazz.cast(doubleMember()));
case "LongMember":
return Optional.ofNullable(clazz.cast(longMember()));
case "SimpleList":
return Optional.ofNullable(clazz.cast(simpleList()));
case "ListOfEnums":
return Optional.ofNullable(clazz.cast(listOfEnumsAsStrings()));
case "ListOfMaps":
return Optional.ofNullable(clazz.cast(listOfMaps()));
case "ListOfStructs":
return Optional.ofNullable(clazz.cast(listOfStructs()));
case "ListOfMapOfEnumToString":
return Optional.ofNullable(clazz.cast(listOfMapOfEnumToStringAsStrings()));
case "MapOfStringToIntegerList":
return Optional.ofNullable(clazz.cast(mapOfStringToIntegerList()));
case "MapOfStringToString":
return Optional.ofNullable(clazz.cast(mapOfStringToString()));
case "MapOfStringToSimpleStruct":
return Optional.ofNullable(clazz.cast(mapOfStringToSimpleStruct()));
case "MapOfEnumToEnum":
return Optional.ofNullable(clazz.cast(mapOfEnumToEnumAsStrings()));
case "MapOfEnumToString":
return Optional.ofNullable(clazz.cast(mapOfEnumToStringAsStrings()));
case "MapOfStringToEnum":
return Optional.ofNullable(clazz.cast(mapOfStringToEnumAsStrings()));
case "MapOfEnumToSimpleStruct":
return Optional.ofNullable(clazz.cast(mapOfEnumToSimpleStructAsStrings()));
case "MapOfEnumToListOfEnums":
return Optional.ofNullable(clazz.cast(mapOfEnumToListOfEnumsAsStrings()));
case "MapOfEnumToMapOfStringToEnum":
return Optional.ofNullable(clazz.cast(mapOfEnumToMapOfStringToEnumAsStrings()));
case "TimestampMember":
return Optional.ofNullable(clazz.cast(timestampMember()));
case "StructWithNestedTimestampMember":
return Optional.ofNullable(clazz.cast(structWithNestedTimestampMember()));
case "BlobArg":
return Optional.ofNullable(clazz.cast(blobArg()));
case "StructWithNestedBlob":
return Optional.ofNullable(clazz.cast(structWithNestedBlob()));
case "BlobMap":
return Optional.ofNullable(clazz.cast(blobMap()));
case "ListOfBlobs":
return Optional.ofNullable(clazz.cast(listOfBlobs()));
case "RecursiveStruct":
return Optional.ofNullable(clazz.cast(recursiveStruct()));
case "PolymorphicTypeWithSubTypes":
return Optional.ofNullable(clazz.cast(polymorphicTypeWithSubTypes()));
case "PolymorphicTypeWithoutSubTypes":
return Optional.ofNullable(clazz.cast(polymorphicTypeWithoutSubTypes()));
case "EnumType":
return Optional.ofNullable(clazz.cast(enumTypeAsString()));
default:
return Optional.empty();
}
}
@Override
public final List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
private static <T> Function<Object, T> getter(Function<AllTypesResponse, T> g) {
return obj -> g.apply((AllTypesResponse) obj);
}
private static <T> BiConsumer<Object, T> setter(BiConsumer<Builder, T> s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
public interface Builder extends JsonProtocolTestsResponse.Builder, SdkPojo, CopyableBuilder<Builder, AllTypesResponse> {
/**
* Sets the value of the StringMember property for this object.
*
* @param stringMember
* The new value for the StringMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder stringMember(String stringMember);
/**
* Sets the value of the IntegerMember property for this object.
*
* @param integerMember
* The new value for the IntegerMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder integerMember(Integer integerMember);
/**
* Sets the value of the BooleanMember property for this object.
*
* @param booleanMember
* The new value for the BooleanMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder booleanMember(Boolean booleanMember);
/**
* Sets the value of the FloatMember property for this object.
*
* @param floatMember
* The new value for the FloatMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder floatMember(Float floatMember);
/**
* Sets the value of the DoubleMember property for this object.
*
* @param doubleMember
* The new value for the DoubleMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder doubleMember(Double doubleMember);
/**
* Sets the value of the LongMember property for this object.
*
* @param longMember
* The new value for the LongMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder longMember(Long longMember);
/**
* Sets the value of the SimpleList property for this object.
*
* @param simpleList
* The new value for the SimpleList property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder simpleList(Collection<String> simpleList);
/**
* Sets the value of the SimpleList property for this object.
*
* @param simpleList
* The new value for the SimpleList property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder simpleList(String... simpleList);
/**
* Sets the value of the ListOfEnums property for this object.
*
* @param listOfEnums
* The new value for the ListOfEnums property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfEnumsWithStrings(Collection<String> listOfEnums);
/**
* Sets the value of the ListOfEnums property for this object.
*
* @param listOfEnums
* The new value for the ListOfEnums property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfEnumsWithStrings(String... listOfEnums);
/**
* Sets the value of the ListOfEnums property for this object.
*
* @param listOfEnums
* The new value for the ListOfEnums property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfEnums(Collection<EnumType> listOfEnums);
/**
* Sets the value of the ListOfEnums property for this object.
*
* @param listOfEnums
* The new value for the ListOfEnums property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfEnums(EnumType... listOfEnums);
/**
* Sets the value of the ListOfMaps property for this object.
*
* @param listOfMaps
* The new value for the ListOfMaps property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfMaps(Collection<? extends Map<String, String>> listOfMaps);
/**
* Sets the value of the ListOfMaps property for this object.
*
* @param listOfMaps
* The new value for the ListOfMaps property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfMaps(Map<String, String>... listOfMaps);
/**
* Sets the value of the ListOfStructs property for this object.
*
* @param listOfStructs
* The new value for the ListOfStructs property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfStructs(Collection<SimpleStruct> listOfStructs);
/**
* Sets the value of the ListOfStructs property for this object.
*
* @param listOfStructs
* The new value for the ListOfStructs property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfStructs(SimpleStruct... listOfStructs);
/**
* Sets the value of the ListOfStructs property for this object.
*
* This is a convenience that creates an instance of the {@link List<SimpleStruct>.Builder} avoiding the need to
* create one manually via {@link List<SimpleStruct>#builder()}.
*
* When the {@link Consumer} completes, {@link List<SimpleStruct>.Builder#build()} is called immediately and its
* result is passed to {@link #listOfStructs(List<SimpleStruct>)}.
*
* @param listOfStructs
* a consumer that will call methods on {@link List<SimpleStruct>.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #listOfStructs(List<SimpleStruct>)
*/
Builder listOfStructs(Consumer<SimpleStruct.Builder>... listOfStructs);
/**
* Sets the value of the ListOfMapOfEnumToString property for this object.
*
* @param listOfMapOfEnumToString
* The new value for the ListOfMapOfEnumToString property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfMapOfEnumToStringWithStrings(Collection<? extends Map<String, String>> listOfMapOfEnumToString);
/**
* Sets the value of the ListOfMapOfEnumToString property for this object.
*
* @param listOfMapOfEnumToString
* The new value for the ListOfMapOfEnumToString property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfMapOfEnumToStringWithStrings(Map<String, String>... listOfMapOfEnumToString);
/**
* Sets the value of the MapOfStringToIntegerList property for this object.
*
* @param mapOfStringToIntegerList
* The new value for the MapOfStringToIntegerList property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfStringToIntegerList(Map<String, ? extends Collection<Integer>> mapOfStringToIntegerList);
/**
* Sets the value of the MapOfStringToString property for this object.
*
* @param mapOfStringToString
* The new value for the MapOfStringToString property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfStringToString(Map<String, String> mapOfStringToString);
/**
* Sets the value of the MapOfStringToSimpleStruct property for this object.
*
* @param mapOfStringToSimpleStruct
* The new value for the MapOfStringToSimpleStruct property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfStringToSimpleStruct(Map<String, SimpleStruct> mapOfStringToSimpleStruct);
/**
* Sets the value of the MapOfEnumToEnum property for this object.
*
* @param mapOfEnumToEnum
* The new value for the MapOfEnumToEnum property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfEnumToEnumWithStrings(Map<String, String> mapOfEnumToEnum);
/**
* Sets the value of the MapOfEnumToEnum property for this object.
*
* @param mapOfEnumToEnum
* The new value for the MapOfEnumToEnum property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfEnumToEnum(Map<EnumType, EnumType> mapOfEnumToEnum);
/**
* Sets the value of the MapOfEnumToString property for this object.
*
* @param mapOfEnumToString
* The new value for the MapOfEnumToString property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfEnumToStringWithStrings(Map<String, String> mapOfEnumToString);
/**
* Sets the value of the MapOfEnumToString property for this object.
*
* @param mapOfEnumToString
* The new value for the MapOfEnumToString property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfEnumToString(Map<EnumType, String> mapOfEnumToString);
/**
* Sets the value of the MapOfStringToEnum property for this object.
*
* @param mapOfStringToEnum
* The new value for the MapOfStringToEnum property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfStringToEnumWithStrings(Map<String, String> mapOfStringToEnum);
/**
* Sets the value of the MapOfStringToEnum property for this object.
*
* @param mapOfStringToEnum
* The new value for the MapOfStringToEnum property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfStringToEnum(Map<String, EnumType> mapOfStringToEnum);
/**
* Sets the value of the MapOfEnumToSimpleStruct property for this object.
*
* @param mapOfEnumToSimpleStruct
* The new value for the MapOfEnumToSimpleStruct property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfEnumToSimpleStructWithStrings(Map<String, SimpleStruct> mapOfEnumToSimpleStruct);
/**
* Sets the value of the MapOfEnumToSimpleStruct property for this object.
*
* @param mapOfEnumToSimpleStruct
* The new value for the MapOfEnumToSimpleStruct property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfEnumToSimpleStruct(Map<EnumType, SimpleStruct> mapOfEnumToSimpleStruct);
/**
* Sets the value of the MapOfEnumToListOfEnums property for this object.
*
* @param mapOfEnumToListOfEnums
* The new value for the MapOfEnumToListOfEnums property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfEnumToListOfEnumsWithStrings(Map<String, ? extends Collection<String>> mapOfEnumToListOfEnums);
/**
* Sets the value of the MapOfEnumToListOfEnums property for this object.
*
* @param mapOfEnumToListOfEnums
* The new value for the MapOfEnumToListOfEnums property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfEnumToListOfEnums(Map<EnumType, ? extends Collection<EnumType>> mapOfEnumToListOfEnums);
/**
* Sets the value of the MapOfEnumToMapOfStringToEnum property for this object.
*
* @param mapOfEnumToMapOfStringToEnum
* The new value for the MapOfEnumToMapOfStringToEnum property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfEnumToMapOfStringToEnumWithStrings(Map<String, Map<String, String>> mapOfEnumToMapOfStringToEnum);
/**
* Sets the value of the MapOfEnumToMapOfStringToEnum property for this object.
*
* @param mapOfEnumToMapOfStringToEnum
* The new value for the MapOfEnumToMapOfStringToEnum property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfEnumToMapOfStringToEnum(Map<EnumType, Map<String, EnumType>> mapOfEnumToMapOfStringToEnum);
/**
* Sets the value of the TimestampMember property for this object.
*
* @param timestampMember
* The new value for the TimestampMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder timestampMember(Instant timestampMember);
/**
* Sets the value of the StructWithNestedTimestampMember property for this object.
*
* @param structWithNestedTimestampMember
* The new value for the StructWithNestedTimestampMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder structWithNestedTimestampMember(StructWithTimestamp structWithNestedTimestampMember);
/**
* Sets the value of the StructWithNestedTimestampMember property for this object.
*
* This is a convenience that creates an instance of the {@link StructWithTimestamp.Builder} avoiding the need
* to create one manually via {@link StructWithTimestamp#builder()}.
*
* When the {@link Consumer} completes, {@link StructWithTimestamp.Builder#build()} is called immediately and
* its result is passed to {@link #structWithNestedTimestampMember(StructWithTimestamp)}.
*
* @param structWithNestedTimestampMember
* a consumer that will call methods on {@link StructWithTimestamp.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #structWithNestedTimestampMember(StructWithTimestamp)
*/
default Builder structWithNestedTimestampMember(Consumer<StructWithTimestamp.Builder> structWithNestedTimestampMember) {
return structWithNestedTimestampMember(StructWithTimestamp.builder().applyMutation(structWithNestedTimestampMember)
.build());
}
/**
* Sets the value of the BlobArg property for this object.
*
* @param blobArg
* The new value for the BlobArg property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder blobArg(SdkBytes blobArg);
/**
* Sets the value of the StructWithNestedBlob property for this object.
*
* @param structWithNestedBlob
* The new value for the StructWithNestedBlob property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder structWithNestedBlob(StructWithNestedBlobType structWithNestedBlob);
/**
* Sets the value of the StructWithNestedBlob property for this object.
*
* This is a convenience that creates an instance of the {@link StructWithNestedBlobType.Builder} avoiding the
* need to create one manually via {@link StructWithNestedBlobType#builder()}.
*
* When the {@link Consumer} completes, {@link StructWithNestedBlobType.Builder#build()} is called immediately
* and its result is passed to {@link #structWithNestedBlob(StructWithNestedBlobType)}.
*
* @param structWithNestedBlob
* a consumer that will call methods on {@link StructWithNestedBlobType.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #structWithNestedBlob(StructWithNestedBlobType)
*/
default Builder structWithNestedBlob(Consumer<StructWithNestedBlobType.Builder> structWithNestedBlob) {
return structWithNestedBlob(StructWithNestedBlobType.builder().applyMutation(structWithNestedBlob).build());
}
/**
* Sets the value of the BlobMap property for this object.
*
* @param blobMap
* The new value for the BlobMap property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder blobMap(Map<String, SdkBytes> blobMap);
/**
* Sets the value of the ListOfBlobs property for this object.
*
* @param listOfBlobs
* The new value for the ListOfBlobs property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfBlobs(Collection<SdkBytes> listOfBlobs);
/**
* Sets the value of the ListOfBlobs property for this object.
*
* @param listOfBlobs
* The new value for the ListOfBlobs property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfBlobs(SdkBytes... listOfBlobs);
/**
* Sets the value of the RecursiveStruct property for this object.
*
* @param recursiveStruct
* The new value for the RecursiveStruct property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder recursiveStruct(RecursiveStructType recursiveStruct);
/**
* Sets the value of the RecursiveStruct property for this object.
*
* This is a convenience that creates an instance of the {@link RecursiveStructType.Builder} avoiding the need
* to create one manually via {@link RecursiveStructType#builder()}.
*
* When the {@link Consumer} completes, {@link RecursiveStructType.Builder#build()} is called immediately and
* its result is passed to {@link #recursiveStruct(RecursiveStructType)}.
*
* @param recursiveStruct
* a consumer that will call methods on {@link RecursiveStructType.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #recursiveStruct(RecursiveStructType)
*/
default Builder recursiveStruct(Consumer<RecursiveStructType.Builder> recursiveStruct) {
return recursiveStruct(RecursiveStructType.builder().applyMutation(recursiveStruct).build());
}
/**
* Sets the value of the PolymorphicTypeWithSubTypes property for this object.
*
* @param polymorphicTypeWithSubTypes
* The new value for the PolymorphicTypeWithSubTypes property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder polymorphicTypeWithSubTypes(BaseType polymorphicTypeWithSubTypes);
/**
* Sets the value of the PolymorphicTypeWithSubTypes property for this object.
*
* This is a convenience that creates an instance of the {@link BaseType.Builder} avoiding the need to create
* one manually via {@link BaseType#builder()}.
*
* When the {@link Consumer} completes, {@link BaseType.Builder#build()} is called immediately and its result is
* passed to {@link #polymorphicTypeWithSubTypes(BaseType)}.
*
* @param polymorphicTypeWithSubTypes
* a consumer that will call methods on {@link BaseType.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #polymorphicTypeWithSubTypes(BaseType)
*/
default Builder polymorphicTypeWithSubTypes(Consumer<BaseType.Builder> polymorphicTypeWithSubTypes) {
return polymorphicTypeWithSubTypes(BaseType.builder().applyMutation(polymorphicTypeWithSubTypes).build());
}
/**
* Sets the value of the PolymorphicTypeWithoutSubTypes property for this object.
*
* @param polymorphicTypeWithoutSubTypes
* The new value for the PolymorphicTypeWithoutSubTypes property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder polymorphicTypeWithoutSubTypes(SubTypeOne polymorphicTypeWithoutSubTypes);
/**
* Sets the value of the PolymorphicTypeWithoutSubTypes property for this object.
*
* This is a convenience that creates an instance of the {@link SubTypeOne.Builder} avoiding the need to create
* one manually via {@link SubTypeOne#builder()}.
*
* When the {@link Consumer} completes, {@link SubTypeOne.Builder#build()} is called immediately and its result
* is passed to {@link #polymorphicTypeWithoutSubTypes(SubTypeOne)}.
*
* @param polymorphicTypeWithoutSubTypes
* a consumer that will call methods on {@link SubTypeOne.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #polymorphicTypeWithoutSubTypes(SubTypeOne)
*/
default Builder polymorphicTypeWithoutSubTypes(Consumer<SubTypeOne.Builder> polymorphicTypeWithoutSubTypes) {
return polymorphicTypeWithoutSubTypes(SubTypeOne.builder().applyMutation(polymorphicTypeWithoutSubTypes).build());
}
/**
* Sets the value of the EnumType property for this object.
*
* @param enumType
* The new value for the EnumType property for this object.
* @see EnumType
* @return Returns a reference to this object so that method calls can be chained together.
* @see EnumType
*/
Builder enumType(String enumType);
/**
* Sets the value of the EnumType property for this object.
*
* @param enumType
* The new value for the EnumType property for this object.
* @see EnumType
* @return Returns a reference to this object so that method calls can be chained together.
* @see EnumType
*/
Builder enumType(EnumType enumType);
}
static final class BuilderImpl extends JsonProtocolTestsResponse.BuilderImpl implements Builder {
private String stringMember;
private Integer integerMember;
private Boolean booleanMember;
private Float floatMember;
private Double doubleMember;
private Long longMember;
private List<String> simpleList;
private List<String> listOfEnums;
private List<Map<String, String>> listOfMaps;
private List<SimpleStruct> listOfStructs;
private List<Map<String, String>> listOfMapOfEnumToString;
private Map<String, List<Integer>> mapOfStringToIntegerList;
private Map<String, String> mapOfStringToString;
private Map<String, SimpleStruct> mapOfStringToSimpleStruct;
private Map<String, String> mapOfEnumToEnum;
private Map<String, String> mapOfEnumToString;
private Map<String, String> mapOfStringToEnum;
private Map<String, SimpleStruct> mapOfEnumToSimpleStruct;
private Map<String, List<String>> mapOfEnumToListOfEnums;
private Map<String, Map<String, String>> mapOfEnumToMapOfStringToEnum;
private Instant timestampMember;
private StructWithTimestamp structWithNestedTimestampMember;
private SdkBytes blobArg;
private StructWithNestedBlobType structWithNestedBlob;
private Map<String, SdkBytes> blobMap;
private List<SdkBytes> listOfBlobs;
private RecursiveStructType recursiveStruct;
private BaseType polymorphicTypeWithSubTypes;
private SubTypeOne polymorphicTypeWithoutSubTypes;
private String enumType;
private BuilderImpl() {
}
private BuilderImpl(AllTypesResponse model) {
super(model);
stringMember(model.stringMember);
integerMember(model.integerMember);
booleanMember(model.booleanMember);
floatMember(model.floatMember);
doubleMember(model.doubleMember);
longMember(model.longMember);
simpleList(model.simpleList);
listOfEnumsWithStrings(model.listOfEnums);
listOfMaps(model.listOfMaps);
listOfStructs(model.listOfStructs);
listOfMapOfEnumToStringWithStrings(model.listOfMapOfEnumToString);
mapOfStringToIntegerList(model.mapOfStringToIntegerList);
mapOfStringToString(model.mapOfStringToString);
mapOfStringToSimpleStruct(model.mapOfStringToSimpleStruct);
mapOfEnumToEnumWithStrings(model.mapOfEnumToEnum);
mapOfEnumToStringWithStrings(model.mapOfEnumToString);
mapOfStringToEnumWithStrings(model.mapOfStringToEnum);
mapOfEnumToSimpleStructWithStrings(model.mapOfEnumToSimpleStruct);
mapOfEnumToListOfEnumsWithStrings(model.mapOfEnumToListOfEnums);
mapOfEnumToMapOfStringToEnumWithStrings(model.mapOfEnumToMapOfStringToEnum);
timestampMember(model.timestampMember);
structWithNestedTimestampMember(model.structWithNestedTimestampMember);
blobArg(model.blobArg);
structWithNestedBlob(model.structWithNestedBlob);
blobMap(model.blobMap);
listOfBlobs(model.listOfBlobs);
recursiveStruct(model.recursiveStruct);
polymorphicTypeWithSubTypes(model.polymorphicTypeWithSubTypes);
polymorphicTypeWithoutSubTypes(model.polymorphicTypeWithoutSubTypes);
enumType(model.enumType);
}
public final String getStringMember() {
return stringMember;
}
@Override
public final Builder stringMember(String stringMember) {
this.stringMember = stringMember;
return this;
}
public final void setStringMember(String stringMember) {
this.stringMember = stringMember;
}
public final Integer getIntegerMember() {
return integerMember;
}
@Override
public final Builder integerMember(Integer integerMember) {
this.integerMember = integerMember;
return this;
}
public final void setIntegerMember(Integer integerMember) {
this.integerMember = integerMember;
}
public final Boolean getBooleanMember() {
return booleanMember;
}
@Override
public final Builder booleanMember(Boolean booleanMember) {
this.booleanMember = booleanMember;
return this;
}
public final void setBooleanMember(Boolean booleanMember) {
this.booleanMember = booleanMember;
}
public final Float getFloatMember() {
return floatMember;
}
@Override
public final Builder floatMember(Float floatMember) {
this.floatMember = floatMember;
return this;
}
public final void setFloatMember(Float floatMember) {
this.floatMember = floatMember;
}
public final Double getDoubleMember() {
return doubleMember;
}
@Override
public final Builder doubleMember(Double doubleMember) {
this.doubleMember = doubleMember;
return this;
}
public final void setDoubleMember(Double doubleMember) {
this.doubleMember = doubleMember;
}
public final Long getLongMember() {
return longMember;
}
@Override
public final Builder longMember(Long longMember) {
this.longMember = longMember;
return this;
}
public final void setLongMember(Long longMember) {
this.longMember = longMember;
}
public final Collection<String> getSimpleList() {
return simpleList;
}
@Override
public final Builder simpleList(Collection<String> simpleList) {
this.simpleList = ListOfStringsCopier.copy(simpleList);
return this;
}
@Override
@SafeVarargs
public final Builder simpleList(String... simpleList) {
simpleList(Arrays.asList(simpleList));
return this;
}
public final void setSimpleList(Collection<String> simpleList) {
this.simpleList = ListOfStringsCopier.copy(simpleList);
}
public final Collection<String> getListOfEnums() {
return listOfEnums;
}
@Override
public final Builder listOfEnumsWithStrings(Collection<String> listOfEnums) {
this.listOfEnums = ListOfEnumsCopier.copy(listOfEnums);
return this;
}
@Override
@SafeVarargs
public final Builder listOfEnumsWithStrings(String... listOfEnums) {
listOfEnumsWithStrings(Arrays.asList(listOfEnums));
return this;
}
@Override
public final Builder listOfEnums(Collection<EnumType> listOfEnums) {
this.listOfEnums = ListOfEnumsCopier.copyEnumToString(listOfEnums);
return this;
}
@Override
@SafeVarargs
public final Builder listOfEnums(EnumType... listOfEnums) {
listOfEnums(Arrays.asList(listOfEnums));
return this;
}
public final void setListOfEnums(Collection<String> listOfEnums) {
this.listOfEnums = ListOfEnumsCopier.copy(listOfEnums);
}
public final Collection<? extends Map<String, String>> getListOfMaps() {
return listOfMaps;
}
@Override
public final Builder listOfMaps(Collection<? extends Map<String, String>> listOfMaps) {
this.listOfMaps = ListOfMapStringToStringCopier.copy(listOfMaps);
return this;
}
@Override
@SafeVarargs
public final Builder listOfMaps(Map<String, String>... listOfMaps) {
listOfMaps(Arrays.asList(listOfMaps));
return this;
}
public final void setListOfMaps(Collection<? extends Map<String, String>> listOfMaps) {
this.listOfMaps = ListOfMapStringToStringCopier.copy(listOfMaps);
}
public final Collection<SimpleStruct.Builder> getListOfStructs() {
return listOfStructs != null ? listOfStructs.stream().map(SimpleStruct::toBuilder).collect(Collectors.toList())
: null;
}
@Override
public final Builder listOfStructs(Collection<SimpleStruct> listOfStructs) {
this.listOfStructs = ListOfSimpleStructsCopier.copy(listOfStructs);
return this;
}
@Override
@SafeVarargs
public final Builder listOfStructs(SimpleStruct... listOfStructs) {
listOfStructs(Arrays.asList(listOfStructs));
return this;
}
@Override
@SafeVarargs
public final Builder listOfStructs(Consumer<SimpleStruct.Builder>... listOfStructs) {
listOfStructs(Stream.of(listOfStructs).map(c -> SimpleStruct.builder().applyMutation(c).build())
.collect(Collectors.toList()));
return this;
}
public final void setListOfStructs(Collection<SimpleStruct.BuilderImpl> listOfStructs) {
this.listOfStructs = ListOfSimpleStructsCopier.copyFromBuilder(listOfStructs);
}
public final Collection<? extends Map<String, String>> getListOfMapOfEnumToString() {
return listOfMapOfEnumToString;
}
@Override
public final Builder listOfMapOfEnumToStringWithStrings(Collection<? extends Map<String, String>> listOfMapOfEnumToString) {
this.listOfMapOfEnumToString = ListOfMapOfEnumToStringCopier.copy(listOfMapOfEnumToString);
return this;
}
@Override
@SafeVarargs
public final Builder listOfMapOfEnumToStringWithStrings(Map<String, String>... listOfMapOfEnumToString) {
listOfMapOfEnumToStringWithStrings(Arrays.asList(listOfMapOfEnumToString));
return this;
}
public final void setListOfMapOfEnumToString(Collection<? extends Map<String, String>> listOfMapOfEnumToString) {
this.listOfMapOfEnumToString = ListOfMapOfEnumToStringCopier.copy(listOfMapOfEnumToString);
}
public final Map<String, ? extends Collection<Integer>> getMapOfStringToIntegerList() {
return mapOfStringToIntegerList;
}
@Override
public final Builder mapOfStringToIntegerList(Map<String, ? extends Collection<Integer>> mapOfStringToIntegerList) {
this.mapOfStringToIntegerList = MapOfStringToIntegerListCopier.copy(mapOfStringToIntegerList);
return this;
}
public final void setMapOfStringToIntegerList(Map<String, ? extends Collection<Integer>> mapOfStringToIntegerList) {
this.mapOfStringToIntegerList = MapOfStringToIntegerListCopier.copy(mapOfStringToIntegerList);
}
public final Map<String, String> getMapOfStringToString() {
return mapOfStringToString;
}
@Override
public final Builder mapOfStringToString(Map<String, String> mapOfStringToString) {
this.mapOfStringToString = MapOfStringToStringCopier.copy(mapOfStringToString);
return this;
}
public final void setMapOfStringToString(Map<String, String> mapOfStringToString) {
this.mapOfStringToString = MapOfStringToStringCopier.copy(mapOfStringToString);
}
public final Map<String, SimpleStruct.Builder> getMapOfStringToSimpleStruct() {
return mapOfStringToSimpleStruct != null ? CollectionUtils.mapValues(mapOfStringToSimpleStruct,
SimpleStruct::toBuilder) : null;
}
@Override
public final Builder mapOfStringToSimpleStruct(Map<String, SimpleStruct> mapOfStringToSimpleStruct) {
this.mapOfStringToSimpleStruct = MapOfStringToSimpleStructCopier.copy(mapOfStringToSimpleStruct);
return this;
}
public final void setMapOfStringToSimpleStruct(Map<String, SimpleStruct.BuilderImpl> mapOfStringToSimpleStruct) {
this.mapOfStringToSimpleStruct = MapOfStringToSimpleStructCopier.copyFromBuilder(mapOfStringToSimpleStruct);
}
public final Map<String, String> getMapOfEnumToEnum() {
return mapOfEnumToEnum;
}
@Override
public final Builder mapOfEnumToEnumWithStrings(Map<String, String> mapOfEnumToEnum) {
this.mapOfEnumToEnum = MapOfEnumToEnumCopier.copy(mapOfEnumToEnum);
return this;
}
@Override
public final Builder mapOfEnumToEnum(Map<EnumType, EnumType> mapOfEnumToEnum) {
this.mapOfEnumToEnum = MapOfEnumToEnumCopier.copyEnumToString(mapOfEnumToEnum);
return this;
}
public final void setMapOfEnumToEnum(Map<String, String> mapOfEnumToEnum) {
this.mapOfEnumToEnum = MapOfEnumToEnumCopier.copy(mapOfEnumToEnum);
}
public final Map<String, String> getMapOfEnumToString() {
return mapOfEnumToString;
}
@Override
public final Builder mapOfEnumToStringWithStrings(Map<String, String> mapOfEnumToString) {
this.mapOfEnumToString = MapOfEnumToStringCopier.copy(mapOfEnumToString);
return this;
}
@Override
public final Builder mapOfEnumToString(Map<EnumType, String> mapOfEnumToString) {
this.mapOfEnumToString = MapOfEnumToStringCopier.copyEnumToString(mapOfEnumToString);
return this;
}
public final void setMapOfEnumToString(Map<String, String> mapOfEnumToString) {
this.mapOfEnumToString = MapOfEnumToStringCopier.copy(mapOfEnumToString);
}
public final Map<String, String> getMapOfStringToEnum() {
return mapOfStringToEnum;
}
@Override
public final Builder mapOfStringToEnumWithStrings(Map<String, String> mapOfStringToEnum) {
this.mapOfStringToEnum = MapOfStringToEnumCopier.copy(mapOfStringToEnum);
return this;
}
@Override
public final Builder mapOfStringToEnum(Map<String, EnumType> mapOfStringToEnum) {
this.mapOfStringToEnum = MapOfStringToEnumCopier.copyEnumToString(mapOfStringToEnum);
return this;
}
public final void setMapOfStringToEnum(Map<String, String> mapOfStringToEnum) {
this.mapOfStringToEnum = MapOfStringToEnumCopier.copy(mapOfStringToEnum);
}
public final Map<String, SimpleStruct.Builder> getMapOfEnumToSimpleStruct() {
return mapOfEnumToSimpleStruct != null ? CollectionUtils.mapValues(mapOfEnumToSimpleStruct, SimpleStruct::toBuilder)
: null;
}
@Override
public final Builder mapOfEnumToSimpleStructWithStrings(Map<String, SimpleStruct> mapOfEnumToSimpleStruct) {
this.mapOfEnumToSimpleStruct = MapOfEnumToSimpleStructCopier.copy(mapOfEnumToSimpleStruct);
return this;
}
@Override
public final Builder mapOfEnumToSimpleStruct(Map<EnumType, SimpleStruct> mapOfEnumToSimpleStruct) {
this.mapOfEnumToSimpleStruct = MapOfEnumToSimpleStructCopier.copyEnumToString(mapOfEnumToSimpleStruct);
return this;
}
public final void setMapOfEnumToSimpleStruct(Map<String, SimpleStruct.BuilderImpl> mapOfEnumToSimpleStruct) {
this.mapOfEnumToSimpleStruct = MapOfEnumToSimpleStructCopier.copyFromBuilder(mapOfEnumToSimpleStruct);
}
public final Map<String, ? extends Collection<String>> getMapOfEnumToListOfEnums() {
return mapOfEnumToListOfEnums;
}
@Override
public final Builder mapOfEnumToListOfEnumsWithStrings(Map<String, ? extends Collection<String>> mapOfEnumToListOfEnums) {
this.mapOfEnumToListOfEnums = MapOfEnumToListOfEnumsCopier.copy(mapOfEnumToListOfEnums);
return this;
}
@Override
public final Builder mapOfEnumToListOfEnums(Map<EnumType, ? extends Collection<EnumType>> mapOfEnumToListOfEnums) {
this.mapOfEnumToListOfEnums = MapOfEnumToListOfEnumsCopier.copyEnumToString(mapOfEnumToListOfEnums);
return this;
}
public final void setMapOfEnumToListOfEnums(Map<String, ? extends Collection<String>> mapOfEnumToListOfEnums) {
this.mapOfEnumToListOfEnums = MapOfEnumToListOfEnumsCopier.copy(mapOfEnumToListOfEnums);
}
public final Map<String, Map<String, String>> getMapOfEnumToMapOfStringToEnum() {
return mapOfEnumToMapOfStringToEnum;
}
@Override
public final Builder mapOfEnumToMapOfStringToEnumWithStrings(Map<String, Map<String, String>> mapOfEnumToMapOfStringToEnum) {
this.mapOfEnumToMapOfStringToEnum = MapOfEnumToMapOfStringToEnumCopier.copy(mapOfEnumToMapOfStringToEnum);
return this;
}
@Override
public final Builder mapOfEnumToMapOfStringToEnum(Map<EnumType, Map<String, EnumType>> mapOfEnumToMapOfStringToEnum) {
this.mapOfEnumToMapOfStringToEnum = MapOfEnumToMapOfStringToEnumCopier.copyEnumToString(mapOfEnumToMapOfStringToEnum);
return this;
}
public final void setMapOfEnumToMapOfStringToEnum(Map<String, Map<String, String>> mapOfEnumToMapOfStringToEnum) {
this.mapOfEnumToMapOfStringToEnum = MapOfEnumToMapOfStringToEnumCopier.copy(mapOfEnumToMapOfStringToEnum);
}
public final Instant getTimestampMember() {
return timestampMember;
}
@Override
public final Builder timestampMember(Instant timestampMember) {
this.timestampMember = timestampMember;
return this;
}
public final void setTimestampMember(Instant timestampMember) {
this.timestampMember = timestampMember;
}
public final StructWithTimestamp.Builder getStructWithNestedTimestampMember() {
return structWithNestedTimestampMember != null ? structWithNestedTimestampMember.toBuilder() : null;
}
@Override
public final Builder structWithNestedTimestampMember(StructWithTimestamp structWithNestedTimestampMember) {
this.structWithNestedTimestampMember = structWithNestedTimestampMember;
return this;
}
public final void setStructWithNestedTimestampMember(StructWithTimestamp.BuilderImpl structWithNestedTimestampMember) {
this.structWithNestedTimestampMember = structWithNestedTimestampMember != null ? structWithNestedTimestampMember
.build() : null;
}
public final ByteBuffer getBlobArg() {
return blobArg == null ? null : blobArg.asByteBuffer();
}
@Override
public final Builder blobArg(SdkBytes blobArg) {
this.blobArg = StandardMemberCopier.copy(blobArg);
return this;
}
public final void setBlobArg(ByteBuffer blobArg) {
blobArg(blobArg == null ? null : SdkBytes.fromByteBuffer(blobArg));
}
public final StructWithNestedBlobType.Builder getStructWithNestedBlob() {
return structWithNestedBlob != null ? structWithNestedBlob.toBuilder() : null;
}
@Override
public final Builder structWithNestedBlob(StructWithNestedBlobType structWithNestedBlob) {
this.structWithNestedBlob = structWithNestedBlob;
return this;
}
public final void setStructWithNestedBlob(StructWithNestedBlobType.BuilderImpl structWithNestedBlob) {
this.structWithNestedBlob = structWithNestedBlob != null ? structWithNestedBlob.build() : null;
}
public final Map<String, ByteBuffer> getBlobMap() {
return blobMap == null ? null : blobMap.entrySet().stream()
.collect(Collectors.toMap(e -> e.getKey(), e -> e.getValue().asByteBuffer()));
}
@Override
public final Builder blobMap(Map<String, SdkBytes> blobMap) {
this.blobMap = BlobMapTypeCopier.copy(blobMap);
return this;
}
public final void setBlobMap(Map<String, ByteBuffer> blobMap) {
blobMap(blobMap == null ? null : blobMap.entrySet().stream()
.collect(Collectors.toMap(e -> e.getKey(), e -> SdkBytes.fromByteBuffer(e.getValue()))));
}
public final List<ByteBuffer> getListOfBlobs() {
return listOfBlobs == null ? null : listOfBlobs.stream().map(SdkBytes::asByteBuffer).collect(Collectors.toList());
}
@Override
public final Builder listOfBlobs(Collection<SdkBytes> listOfBlobs) {
this.listOfBlobs = ListOfBlobsTypeCopier.copy(listOfBlobs);
return this;
}
@Override
@SafeVarargs
public final Builder listOfBlobs(SdkBytes... listOfBlobs) {
listOfBlobs(Arrays.asList(listOfBlobs));
return this;
}
public final void setListOfBlobs(Collection<ByteBuffer> listOfBlobs) {
listOfBlobs(listOfBlobs == null ? null : listOfBlobs.stream().map(SdkBytes::fromByteBuffer)
.collect(Collectors.toList()));
}
public final RecursiveStructType.Builder getRecursiveStruct() {
return recursiveStruct != null ? recursiveStruct.toBuilder() : null;
}
@Override
public final Builder recursiveStruct(RecursiveStructType recursiveStruct) {
this.recursiveStruct = recursiveStruct;
return this;
}
public final void setRecursiveStruct(RecursiveStructType.BuilderImpl recursiveStruct) {
this.recursiveStruct = recursiveStruct != null ? recursiveStruct.build() : null;
}
public final BaseType.Builder getPolymorphicTypeWithSubTypes() {
return polymorphicTypeWithSubTypes != null ? polymorphicTypeWithSubTypes.toBuilder() : null;
}
@Override
public final Builder polymorphicTypeWithSubTypes(BaseType polymorphicTypeWithSubTypes) {
this.polymorphicTypeWithSubTypes = polymorphicTypeWithSubTypes;
return this;
}
public final void setPolymorphicTypeWithSubTypes(BaseType.BuilderImpl polymorphicTypeWithSubTypes) {
this.polymorphicTypeWithSubTypes = polymorphicTypeWithSubTypes != null ? polymorphicTypeWithSubTypes.build() : null;
}
public final SubTypeOne.Builder getPolymorphicTypeWithoutSubTypes() {
return polymorphicTypeWithoutSubTypes != null ? polymorphicTypeWithoutSubTypes.toBuilder() : null;
}
@Override
public final Builder polymorphicTypeWithoutSubTypes(SubTypeOne polymorphicTypeWithoutSubTypes) {
this.polymorphicTypeWithoutSubTypes = polymorphicTypeWithoutSubTypes;
return this;
}
public final void setPolymorphicTypeWithoutSubTypes(SubTypeOne.BuilderImpl polymorphicTypeWithoutSubTypes) {
this.polymorphicTypeWithoutSubTypes = polymorphicTypeWithoutSubTypes != null ? polymorphicTypeWithoutSubTypes.build()
: null;
}
public final String getEnumType() {
return enumType;
}
@Override
public final Builder enumType(String enumType) {
this.enumType = enumType;
return this;
}
@Override
public final Builder enumType(EnumType enumType) {
this.enumType(enumType == null ? null : enumType.toString());
return this;
}
public final void setEnumType(String enumType) {
this.enumType = enumType;
}
@Override
public AllTypesResponse build() {
return new AllTypesResponse(this);
}
@Override
public List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
}
}
| 3,484 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/nonautoconstructcontainers/existencechecknamingrequest.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
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.AwsRequestOverrideConfiguration;
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.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.traits.MapTrait;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class ExistenceCheckNamingRequest extends JsonProtocolTestsRequest implements
ToCopyableBuilder<ExistenceCheckNamingRequest.Builder, ExistenceCheckNamingRequest> {
private static final SdkField<List<String>> BUILD_FIELD = SdkField
.<List<String>> builder(MarshallingType.LIST)
.memberName("Build")
.getter(getter(ExistenceCheckNamingRequest::build))
.setter(setter(Builder::build))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Build").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField<List<String>> SUPER_FIELD = SdkField
.<List<String>> builder(MarshallingType.LIST)
.memberName("super")
.getter(getter(ExistenceCheckNamingRequest::superValue))
.setter(setter(Builder::superValue))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("super").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField<Map<String, String>> TO_STRING_FIELD = SdkField
.<Map<String, String>> builder(MarshallingType.MAP)
.memberName("toString")
.getter(getter(ExistenceCheckNamingRequest::toStringValue))
.setter(setter(Builder::toStringValue))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("toString").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build()).build()).build();
private static final SdkField<Map<String, String>> EQUALS_FIELD = SdkField
.<Map<String, String>> builder(MarshallingType.MAP)
.memberName("equals")
.getter(getter(ExistenceCheckNamingRequest::equalsValue))
.setter(setter(Builder::equalsValue))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("equals").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build()).build()).build();
private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(BUILD_FIELD, SUPER_FIELD,
TO_STRING_FIELD, EQUALS_FIELD));
private final List<String> build;
private final List<String> superValue;
private final Map<String, String> toStringValue;
private final Map<String, String> equalsValue;
private ExistenceCheckNamingRequest(BuilderImpl builder) {
super(builder);
this.build = builder.build;
this.superValue = builder.superValue;
this.toStringValue = builder.toStringValue;
this.equalsValue = builder.equalsValue;
}
/**
* Returns true if the Build property was specified by the sender (it may be empty), or false if the sender did not
* specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS service.
*/
public final boolean hasBuild() {
return build != null && !(build instanceof SdkAutoConstructList);
}
/**
* Returns the value of the Build property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* You can use {@link #hasBuild()} to see if a value was sent in this field.
* </p>
*
* @return The value of the Build property for this object.
*/
public final List<String> build() {
return build;
}
/**
* Returns true if the Super property was specified by the sender (it may be empty), or false if the sender did not
* specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS service.
*/
public final boolean hasSuperValue() {
return superValue != null && !(superValue instanceof SdkAutoConstructList);
}
/**
* Returns the value of the Super property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* You can use {@link #hasSuperValue()} to see if a value was sent in this field.
* </p>
*
* @return The value of the Super property for this object.
*/
public final List<String> superValue() {
return superValue;
}
/**
* Returns true if the ToString property was specified by the sender (it may be empty), or false if the sender did
* not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS service.
*/
public final boolean hasToStringValue() {
return toStringValue != null && !(toStringValue instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the ToString property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* You can use {@link #hasToStringValue()} to see if a value was sent in this field.
* </p>
*
* @return The value of the ToString property for this object.
*/
public final Map<String, String> toStringValue() {
return toStringValue;
}
/**
* Returns true if the Equals property was specified by the sender (it may be empty), or false if the sender did not
* specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS service.
*/
public final boolean hasEqualsValue() {
return equalsValue != null && !(equalsValue instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the Equals property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* You can use {@link #hasEqualsValue()} to see if a value was sent in this field.
* </p>
*
* @return The value of the Equals property for this object.
*/
public final Map<String, String> equalsValue() {
return equalsValue;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class<? extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
hashCode = 31 * hashCode + Objects.hashCode(build());
hashCode = 31 * hashCode + Objects.hashCode(superValue());
hashCode = 31 * hashCode + Objects.hashCode(toStringValue());
hashCode = 31 * hashCode + Objects.hashCode(equalsValue());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof ExistenceCheckNamingRequest)) {
return false;
}
ExistenceCheckNamingRequest other = (ExistenceCheckNamingRequest) obj;
return Objects.equals(build(), other.build()) && Objects.equals(superValue(), other.superValue())
&& Objects.equals(toStringValue(), other.toStringValue()) && Objects.equals(equalsValue(), other.equalsValue());
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("ExistenceCheckNamingRequest").add("Build", build()).add("Super", superValue())
.add("ToString", toStringValue()).add("Equals", equalsValue()).build();
}
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
switch (fieldName) {
case "Build":
return Optional.ofNullable(clazz.cast(build()));
case "super":
return Optional.ofNullable(clazz.cast(superValue()));
case "toString":
return Optional.ofNullable(clazz.cast(toStringValue()));
case "equals":
return Optional.ofNullable(clazz.cast(equalsValue()));
default:
return Optional.empty();
}
}
@Override
public final List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
private static <T> Function<Object, T> getter(Function<ExistenceCheckNamingRequest, T> g) {
return obj -> g.apply((ExistenceCheckNamingRequest) obj);
}
private static <T> BiConsumer<Object, T> setter(BiConsumer<Builder, T> s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
public interface Builder extends JsonProtocolTestsRequest.Builder, SdkPojo,
CopyableBuilder<Builder, ExistenceCheckNamingRequest> {
/**
* Sets the value of the Build property for this object.
*
* @param build
* The new value for the Build property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder build(Collection<String> build);
/**
* Sets the value of the Build property for this object.
*
* @param build
* The new value for the Build property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder build(String... build);
/**
* Sets the value of the Super property for this object.
*
* @param superValue
* The new value for the Super property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder superValue(Collection<String> superValue);
/**
* Sets the value of the Super property for this object.
*
* @param superValue
* The new value for the Super property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder superValue(String... superValue);
/**
* Sets the value of the ToString property for this object.
*
* @param toStringValue
* The new value for the ToString property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder toStringValue(Map<String, String> toStringValue);
/**
* Sets the value of the Equals property for this object.
*
* @param equalsValue
* The new value for the Equals property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder equalsValue(Map<String, String> equalsValue);
@Override
Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration);
@Override
Builder overrideConfiguration(Consumer<AwsRequestOverrideConfiguration.Builder> builderConsumer);
}
static final class BuilderImpl extends JsonProtocolTestsRequest.BuilderImpl implements Builder {
private List<String> build;
private List<String> superValue;
private Map<String, String> toStringValue;
private Map<String, String> equalsValue;
private BuilderImpl() {
}
private BuilderImpl(ExistenceCheckNamingRequest model) {
super(model);
build(model.build);
superValue(model.superValue);
toStringValue(model.toStringValue);
equalsValue(model.equalsValue);
}
public final Collection<String> getBuild() {
return build;
}
@Override
public final Builder build(Collection<String> build) {
this.build = ListOfStringsCopier.copy(build);
return this;
}
@Override
@SafeVarargs
public final Builder build(String... build) {
build(Arrays.asList(build));
return this;
}
public final void setBuild(Collection<String> build) {
this.build = ListOfStringsCopier.copy(build);
}
public final Collection<String> getSuperValue() {
return superValue;
}
@Override
public final Builder superValue(Collection<String> superValue) {
this.superValue = ListOfStringsCopier.copy(superValue);
return this;
}
@Override
@SafeVarargs
public final Builder superValue(String... superValue) {
superValue(Arrays.asList(superValue));
return this;
}
public final void setSuperValue(Collection<String> superValue) {
this.superValue = ListOfStringsCopier.copy(superValue);
}
public final Map<String, String> getToStringValue() {
return toStringValue;
}
@Override
public final Builder toStringValue(Map<String, String> toStringValue) {
this.toStringValue = MapOfStringToStringCopier.copy(toStringValue);
return this;
}
public final void setToStringValue(Map<String, String> toStringValue) {
this.toStringValue = MapOfStringToStringCopier.copy(toStringValue);
}
public final Map<String, String> getEqualsValue() {
return equalsValue;
}
@Override
public final Builder equalsValue(Map<String, String> equalsValue) {
this.equalsValue = MapOfStringToStringCopier.copy(equalsValue);
return this;
}
public final void setEqualsValue(Map<String, String> equalsValue) {
this.equalsValue = MapOfStringToStringCopier.copy(equalsValue);
}
@Override
public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) {
super.overrideConfiguration(overrideConfiguration);
return this;
}
@Override
public Builder overrideConfiguration(Consumer<AwsRequestOverrideConfiguration.Builder> builderConsumer) {
super.overrideConfiguration(builderConsumer);
return this;
}
@Override
public ExistenceCheckNamingRequest build() {
return new ExistenceCheckNamingRequest(this);
}
@Override
public List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
}
}
| 3,485 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/nonautoconstructcontainers/alltypesrequest.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import java.nio.ByteBuffer;
import java.time.Instant;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
import software.amazon.awssdk.core.SdkBytes;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.adapter.StandardMemberCopier;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.traits.MapTrait;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
import software.amazon.awssdk.utils.CollectionUtils;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class AllTypesRequest extends JsonProtocolTestsRequest implements
ToCopyableBuilder<AllTypesRequest.Builder, AllTypesRequest> {
private static final SdkField<String> STRING_MEMBER_FIELD = SdkField.<String> builder(MarshallingType.STRING)
.memberName("StringMember").getter(getter(AllTypesRequest::stringMember)).setter(setter(Builder::stringMember))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StringMember").build()).build();
private static final SdkField<Integer> INTEGER_MEMBER_FIELD = SdkField.<Integer> builder(MarshallingType.INTEGER)
.memberName("IntegerMember").getter(getter(AllTypesRequest::integerMember)).setter(setter(Builder::integerMember))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("IntegerMember").build()).build();
private static final SdkField<Boolean> BOOLEAN_MEMBER_FIELD = SdkField.<Boolean> builder(MarshallingType.BOOLEAN)
.memberName("BooleanMember").getter(getter(AllTypesRequest::booleanMember)).setter(setter(Builder::booleanMember))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("BooleanMember").build()).build();
private static final SdkField<Float> FLOAT_MEMBER_FIELD = SdkField.<Float> builder(MarshallingType.FLOAT)
.memberName("FloatMember").getter(getter(AllTypesRequest::floatMember)).setter(setter(Builder::floatMember))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("FloatMember").build()).build();
private static final SdkField<Double> DOUBLE_MEMBER_FIELD = SdkField.<Double> builder(MarshallingType.DOUBLE)
.memberName("DoubleMember").getter(getter(AllTypesRequest::doubleMember)).setter(setter(Builder::doubleMember))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DoubleMember").build()).build();
private static final SdkField<Long> LONG_MEMBER_FIELD = SdkField.<Long> builder(MarshallingType.LONG)
.memberName("LongMember").getter(getter(AllTypesRequest::longMember)).setter(setter(Builder::longMember))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LongMember").build()).build();
private static final SdkField<List<String>> SIMPLE_LIST_FIELD = SdkField
.<List<String>> builder(MarshallingType.LIST)
.memberName("SimpleList")
.getter(getter(AllTypesRequest::simpleList))
.setter(setter(Builder::simpleList))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SimpleList").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField<List<String>> LIST_OF_ENUMS_FIELD = SdkField
.<List<String>> builder(MarshallingType.LIST)
.memberName("ListOfEnums")
.getter(getter(AllTypesRequest::listOfEnumsAsStrings))
.setter(setter(Builder::listOfEnumsWithStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ListOfEnums").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField<List<Map<String, String>>> LIST_OF_MAPS_FIELD = SdkField
.<List<Map<String, String>>> builder(MarshallingType.LIST)
.memberName("ListOfMaps")
.getter(getter(AllTypesRequest::listOfMaps))
.setter(setter(Builder::listOfMaps))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ListOfMaps").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<Map<String, String>> builder(MarshallingType.MAP)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder()
.location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build())
.build()).build()).build()).build();
private static final SdkField<List<SimpleStruct>> LIST_OF_STRUCTS_FIELD = SdkField
.<List<SimpleStruct>> builder(MarshallingType.LIST)
.memberName("ListOfStructs")
.getter(getter(AllTypesRequest::listOfStructs))
.setter(setter(Builder::listOfStructs))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ListOfStructs").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<SimpleStruct> builder(MarshallingType.SDK_POJO)
.constructor(SimpleStruct::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField<List<Map<String, String>>> LIST_OF_MAP_OF_ENUM_TO_STRING_FIELD = SdkField
.<List<Map<String, String>>> builder(MarshallingType.LIST)
.memberName("ListOfMapOfEnumToString")
.getter(getter(AllTypesRequest::listOfMapOfEnumToStringAsStrings))
.setter(setter(Builder::listOfMapOfEnumToStringWithStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ListOfMapOfEnumToString").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<Map<String, String>> builder(MarshallingType.MAP)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder()
.location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build())
.build()).build()).build()).build();
private static final SdkField<Map<String, List<Integer>>> MAP_OF_STRING_TO_INTEGER_LIST_FIELD = SdkField
.<Map<String, List<Integer>>> builder(MarshallingType.MAP)
.memberName("MapOfStringToIntegerList")
.getter(getter(AllTypesRequest::mapOfStringToIntegerList))
.setter(setter(Builder::mapOfStringToIntegerList))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MapOfStringToIntegerList").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<List<Integer>> builder(MarshallingType.LIST)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<Integer> builder(MarshallingType.INTEGER)
.traits(LocationTrait.builder()
.location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build())
.build()).build()).build()).build();
private static final SdkField<Map<String, String>> MAP_OF_STRING_TO_STRING_FIELD = SdkField
.<Map<String, String>> builder(MarshallingType.MAP)
.memberName("MapOfStringToString")
.getter(getter(AllTypesRequest::mapOfStringToString))
.setter(setter(Builder::mapOfStringToString))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MapOfStringToString").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build()).build()).build();
private static final SdkField<Map<String, SimpleStruct>> MAP_OF_STRING_TO_SIMPLE_STRUCT_FIELD = SdkField
.<Map<String, SimpleStruct>> builder(MarshallingType.MAP)
.memberName("MapOfStringToSimpleStruct")
.getter(getter(AllTypesRequest::mapOfStringToSimpleStruct))
.setter(setter(Builder::mapOfStringToSimpleStruct))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MapOfStringToSimpleStruct").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<SimpleStruct> builder(MarshallingType.SDK_POJO)
.constructor(SimpleStruct::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build()).build()).build();
private static final SdkField<Map<String, String>> MAP_OF_ENUM_TO_ENUM_FIELD = SdkField
.<Map<String, String>> builder(MarshallingType.MAP)
.memberName("MapOfEnumToEnum")
.getter(getter(AllTypesRequest::mapOfEnumToEnumAsStrings))
.setter(setter(Builder::mapOfEnumToEnumWithStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MapOfEnumToEnum").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build()).build()).build();
private static final SdkField<Map<String, String>> MAP_OF_ENUM_TO_STRING_FIELD = SdkField
.<Map<String, String>> builder(MarshallingType.MAP)
.memberName("MapOfEnumToString")
.getter(getter(AllTypesRequest::mapOfEnumToStringAsStrings))
.setter(setter(Builder::mapOfEnumToStringWithStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MapOfEnumToString").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build()).build()).build();
private static final SdkField<Map<String, String>> MAP_OF_STRING_TO_ENUM_FIELD = SdkField
.<Map<String, String>> builder(MarshallingType.MAP)
.memberName("MapOfStringToEnum")
.getter(getter(AllTypesRequest::mapOfStringToEnumAsStrings))
.setter(setter(Builder::mapOfStringToEnumWithStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MapOfStringToEnum").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build()).build()).build();
private static final SdkField<Map<String, SimpleStruct>> MAP_OF_ENUM_TO_SIMPLE_STRUCT_FIELD = SdkField
.<Map<String, SimpleStruct>> builder(MarshallingType.MAP)
.memberName("MapOfEnumToSimpleStruct")
.getter(getter(AllTypesRequest::mapOfEnumToSimpleStructAsStrings))
.setter(setter(Builder::mapOfEnumToSimpleStructWithStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MapOfEnumToSimpleStruct").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<SimpleStruct> builder(MarshallingType.SDK_POJO)
.constructor(SimpleStruct::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build()).build()).build();
private static final SdkField<Map<String, List<String>>> MAP_OF_ENUM_TO_LIST_OF_ENUMS_FIELD = SdkField
.<Map<String, List<String>>> builder(MarshallingType.MAP)
.memberName("MapOfEnumToListOfEnums")
.getter(getter(AllTypesRequest::mapOfEnumToListOfEnumsAsStrings))
.setter(setter(Builder::mapOfEnumToListOfEnumsWithStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MapOfEnumToListOfEnums").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<List<String>> builder(MarshallingType.LIST)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder()
.location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build())
.build()).build()).build()).build();
private static final SdkField<Map<String, Map<String, String>>> MAP_OF_ENUM_TO_MAP_OF_STRING_TO_ENUM_FIELD = SdkField
.<Map<String, Map<String, String>>> builder(MarshallingType.MAP)
.memberName("MapOfEnumToMapOfStringToEnum")
.getter(getter(AllTypesRequest::mapOfEnumToMapOfStringToEnumAsStrings))
.setter(setter(Builder::mapOfEnumToMapOfStringToEnumWithStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MapOfEnumToMapOfStringToEnum")
.build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<Map<String, String>> builder(MarshallingType.MAP)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder()
.location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build())
.build()).build()).build()).build();
private static final SdkField<Instant> TIMESTAMP_MEMBER_FIELD = SdkField.<Instant> builder(MarshallingType.INSTANT)
.memberName("TimestampMember").getter(getter(AllTypesRequest::timestampMember))
.setter(setter(Builder::timestampMember))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TimestampMember").build()).build();
private static final SdkField<StructWithTimestamp> STRUCT_WITH_NESTED_TIMESTAMP_MEMBER_FIELD = SdkField
.<StructWithTimestamp> builder(MarshallingType.SDK_POJO)
.memberName("StructWithNestedTimestampMember")
.getter(getter(AllTypesRequest::structWithNestedTimestampMember))
.setter(setter(Builder::structWithNestedTimestampMember))
.constructor(StructWithTimestamp::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StructWithNestedTimestampMember")
.build()).build();
private static final SdkField<SdkBytes> BLOB_ARG_FIELD = SdkField.<SdkBytes> builder(MarshallingType.SDK_BYTES)
.memberName("BlobArg").getter(getter(AllTypesRequest::blobArg)).setter(setter(Builder::blobArg))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("BlobArg").build()).build();
private static final SdkField<StructWithNestedBlobType> STRUCT_WITH_NESTED_BLOB_FIELD = SdkField
.<StructWithNestedBlobType> builder(MarshallingType.SDK_POJO).memberName("StructWithNestedBlob")
.getter(getter(AllTypesRequest::structWithNestedBlob)).setter(setter(Builder::structWithNestedBlob))
.constructor(StructWithNestedBlobType::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StructWithNestedBlob").build())
.build();
private static final SdkField<Map<String, SdkBytes>> BLOB_MAP_FIELD = SdkField
.<Map<String, SdkBytes>> builder(MarshallingType.MAP)
.memberName("BlobMap")
.getter(getter(AllTypesRequest::blobMap))
.setter(setter(Builder::blobMap))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("BlobMap").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<SdkBytes> builder(MarshallingType.SDK_BYTES)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build()).build()).build();
private static final SdkField<List<SdkBytes>> LIST_OF_BLOBS_FIELD = SdkField
.<List<SdkBytes>> builder(MarshallingType.LIST)
.memberName("ListOfBlobs")
.getter(getter(AllTypesRequest::listOfBlobs))
.setter(setter(Builder::listOfBlobs))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ListOfBlobs").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<SdkBytes> builder(MarshallingType.SDK_BYTES)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField<RecursiveStructType> RECURSIVE_STRUCT_FIELD = SdkField
.<RecursiveStructType> builder(MarshallingType.SDK_POJO).memberName("RecursiveStruct")
.getter(getter(AllTypesRequest::recursiveStruct)).setter(setter(Builder::recursiveStruct))
.constructor(RecursiveStructType::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RecursiveStruct").build()).build();
private static final SdkField<BaseType> POLYMORPHIC_TYPE_WITH_SUB_TYPES_FIELD = SdkField
.<BaseType> builder(MarshallingType.SDK_POJO)
.memberName("PolymorphicTypeWithSubTypes")
.getter(getter(AllTypesRequest::polymorphicTypeWithSubTypes))
.setter(setter(Builder::polymorphicTypeWithSubTypes))
.constructor(BaseType::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("PolymorphicTypeWithSubTypes")
.build()).build();
private static final SdkField<SubTypeOne> POLYMORPHIC_TYPE_WITHOUT_SUB_TYPES_FIELD = SdkField
.<SubTypeOne> builder(MarshallingType.SDK_POJO)
.memberName("PolymorphicTypeWithoutSubTypes")
.getter(getter(AllTypesRequest::polymorphicTypeWithoutSubTypes))
.setter(setter(Builder::polymorphicTypeWithoutSubTypes))
.constructor(SubTypeOne::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("PolymorphicTypeWithoutSubTypes")
.build()).build();
private static final SdkField<String> ENUM_TYPE_FIELD = SdkField.<String> builder(MarshallingType.STRING)
.memberName("EnumType").getter(getter(AllTypesRequest::enumTypeAsString)).setter(setter(Builder::enumType))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EnumType").build()).build();
private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(STRING_MEMBER_FIELD,
INTEGER_MEMBER_FIELD, BOOLEAN_MEMBER_FIELD, FLOAT_MEMBER_FIELD, DOUBLE_MEMBER_FIELD, LONG_MEMBER_FIELD,
SIMPLE_LIST_FIELD, LIST_OF_ENUMS_FIELD, LIST_OF_MAPS_FIELD, LIST_OF_STRUCTS_FIELD,
LIST_OF_MAP_OF_ENUM_TO_STRING_FIELD, MAP_OF_STRING_TO_INTEGER_LIST_FIELD, MAP_OF_STRING_TO_STRING_FIELD,
MAP_OF_STRING_TO_SIMPLE_STRUCT_FIELD, MAP_OF_ENUM_TO_ENUM_FIELD, MAP_OF_ENUM_TO_STRING_FIELD,
MAP_OF_STRING_TO_ENUM_FIELD, MAP_OF_ENUM_TO_SIMPLE_STRUCT_FIELD, MAP_OF_ENUM_TO_LIST_OF_ENUMS_FIELD,
MAP_OF_ENUM_TO_MAP_OF_STRING_TO_ENUM_FIELD, TIMESTAMP_MEMBER_FIELD, STRUCT_WITH_NESTED_TIMESTAMP_MEMBER_FIELD,
BLOB_ARG_FIELD, STRUCT_WITH_NESTED_BLOB_FIELD, BLOB_MAP_FIELD, LIST_OF_BLOBS_FIELD, RECURSIVE_STRUCT_FIELD,
POLYMORPHIC_TYPE_WITH_SUB_TYPES_FIELD, POLYMORPHIC_TYPE_WITHOUT_SUB_TYPES_FIELD, ENUM_TYPE_FIELD));
private final String stringMember;
private final Integer integerMember;
private final Boolean booleanMember;
private final Float floatMember;
private final Double doubleMember;
private final Long longMember;
private final List<String> simpleList;
private final List<String> listOfEnums;
private final List<Map<String, String>> listOfMaps;
private final List<SimpleStruct> listOfStructs;
private final List<Map<String, String>> listOfMapOfEnumToString;
private final Map<String, List<Integer>> mapOfStringToIntegerList;
private final Map<String, String> mapOfStringToString;
private final Map<String, SimpleStruct> mapOfStringToSimpleStruct;
private final Map<String, String> mapOfEnumToEnum;
private final Map<String, String> mapOfEnumToString;
private final Map<String, String> mapOfStringToEnum;
private final Map<String, SimpleStruct> mapOfEnumToSimpleStruct;
private final Map<String, List<String>> mapOfEnumToListOfEnums;
private final Map<String, Map<String, String>> mapOfEnumToMapOfStringToEnum;
private final Instant timestampMember;
private final StructWithTimestamp structWithNestedTimestampMember;
private final SdkBytes blobArg;
private final StructWithNestedBlobType structWithNestedBlob;
private final Map<String, SdkBytes> blobMap;
private final List<SdkBytes> listOfBlobs;
private final RecursiveStructType recursiveStruct;
private final BaseType polymorphicTypeWithSubTypes;
private final SubTypeOne polymorphicTypeWithoutSubTypes;
private final String enumType;
private AllTypesRequest(BuilderImpl builder) {
super(builder);
this.stringMember = builder.stringMember;
this.integerMember = builder.integerMember;
this.booleanMember = builder.booleanMember;
this.floatMember = builder.floatMember;
this.doubleMember = builder.doubleMember;
this.longMember = builder.longMember;
this.simpleList = builder.simpleList;
this.listOfEnums = builder.listOfEnums;
this.listOfMaps = builder.listOfMaps;
this.listOfStructs = builder.listOfStructs;
this.listOfMapOfEnumToString = builder.listOfMapOfEnumToString;
this.mapOfStringToIntegerList = builder.mapOfStringToIntegerList;
this.mapOfStringToString = builder.mapOfStringToString;
this.mapOfStringToSimpleStruct = builder.mapOfStringToSimpleStruct;
this.mapOfEnumToEnum = builder.mapOfEnumToEnum;
this.mapOfEnumToString = builder.mapOfEnumToString;
this.mapOfStringToEnum = builder.mapOfStringToEnum;
this.mapOfEnumToSimpleStruct = builder.mapOfEnumToSimpleStruct;
this.mapOfEnumToListOfEnums = builder.mapOfEnumToListOfEnums;
this.mapOfEnumToMapOfStringToEnum = builder.mapOfEnumToMapOfStringToEnum;
this.timestampMember = builder.timestampMember;
this.structWithNestedTimestampMember = builder.structWithNestedTimestampMember;
this.blobArg = builder.blobArg;
this.structWithNestedBlob = builder.structWithNestedBlob;
this.blobMap = builder.blobMap;
this.listOfBlobs = builder.listOfBlobs;
this.recursiveStruct = builder.recursiveStruct;
this.polymorphicTypeWithSubTypes = builder.polymorphicTypeWithSubTypes;
this.polymorphicTypeWithoutSubTypes = builder.polymorphicTypeWithoutSubTypes;
this.enumType = builder.enumType;
}
/**
* Returns the value of the StringMember property for this object.
*
* @return The value of the StringMember property for this object.
*/
public final String stringMember() {
return stringMember;
}
/**
* Returns the value of the IntegerMember property for this object.
*
* @return The value of the IntegerMember property for this object.
*/
public final Integer integerMember() {
return integerMember;
}
/**
* Returns the value of the BooleanMember property for this object.
*
* @return The value of the BooleanMember property for this object.
*/
public final Boolean booleanMember() {
return booleanMember;
}
/**
* Returns the value of the FloatMember property for this object.
*
* @return The value of the FloatMember property for this object.
*/
public final Float floatMember() {
return floatMember;
}
/**
* Returns the value of the DoubleMember property for this object.
*
* @return The value of the DoubleMember property for this object.
*/
public final Double doubleMember() {
return doubleMember;
}
/**
* Returns the value of the LongMember property for this object.
*
* @return The value of the LongMember property for this object.
*/
public final Long longMember() {
return longMember;
}
/**
* Returns true if the SimpleList property was specified by the sender (it may be empty), or false if the sender did
* not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS service.
*/
public final boolean hasSimpleList() {
return simpleList != null && !(simpleList instanceof SdkAutoConstructList);
}
/**
* Returns the value of the SimpleList property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* You can use {@link #hasSimpleList()} to see if a value was sent in this field.
* </p>
*
* @return The value of the SimpleList property for this object.
*/
public final List<String> simpleList() {
return simpleList;
}
/**
* Returns the value of the ListOfEnums property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* You can use {@link #hasListOfEnums()} to see if a value was sent in this field.
* </p>
*
* @return The value of the ListOfEnums property for this object.
*/
public final List<EnumType> listOfEnums() {
return ListOfEnumsCopier.copyStringToEnum(listOfEnums);
}
/**
* Returns true if the ListOfEnums property was specified by the sender (it may be empty), or false if the sender
* did not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS service.
*/
public final boolean hasListOfEnums() {
return listOfEnums != null && !(listOfEnums instanceof SdkAutoConstructList);
}
/**
* Returns the value of the ListOfEnums property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* You can use {@link #hasListOfEnums()} to see if a value was sent in this field.
* </p>
*
* @return The value of the ListOfEnums property for this object.
*/
public final List<String> listOfEnumsAsStrings() {
return listOfEnums;
}
/**
* Returns true if the ListOfMaps property was specified by the sender (it may be empty), or false if the sender did
* not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS service.
*/
public final boolean hasListOfMaps() {
return listOfMaps != null && !(listOfMaps instanceof SdkAutoConstructList);
}
/**
* Returns the value of the ListOfMaps property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* You can use {@link #hasListOfMaps()} to see if a value was sent in this field.
* </p>
*
* @return The value of the ListOfMaps property for this object.
*/
public final List<Map<String, String>> listOfMaps() {
return listOfMaps;
}
/**
* Returns true if the ListOfStructs property was specified by the sender (it may be empty), or false if the sender
* did not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS service.
*/
public final boolean hasListOfStructs() {
return listOfStructs != null && !(listOfStructs instanceof SdkAutoConstructList);
}
/**
* Returns the value of the ListOfStructs property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* You can use {@link #hasListOfStructs()} to see if a value was sent in this field.
* </p>
*
* @return The value of the ListOfStructs property for this object.
*/
public final List<SimpleStruct> listOfStructs() {
return listOfStructs;
}
/**
* Returns the value of the ListOfMapOfEnumToString property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* You can use {@link #hasListOfMapOfEnumToString()} to see if a value was sent in this field.
* </p>
*
* @return The value of the ListOfMapOfEnumToString property for this object.
*/
public final List<Map<EnumType, String>> listOfMapOfEnumToString() {
return ListOfMapOfEnumToStringCopier.copyStringToEnum(listOfMapOfEnumToString);
}
/**
* Returns true if the ListOfMapOfEnumToString property was specified by the sender (it may be empty), or false if
* the sender did not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS
* service.
*/
public final boolean hasListOfMapOfEnumToString() {
return listOfMapOfEnumToString != null && !(listOfMapOfEnumToString instanceof SdkAutoConstructList);
}
/**
* Returns the value of the ListOfMapOfEnumToString property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* You can use {@link #hasListOfMapOfEnumToString()} to see if a value was sent in this field.
* </p>
*
* @return The value of the ListOfMapOfEnumToString property for this object.
*/
public final List<Map<String, String>> listOfMapOfEnumToStringAsStrings() {
return listOfMapOfEnumToString;
}
/**
* Returns true if the MapOfStringToIntegerList property was specified by the sender (it may be empty), or false if
* the sender did not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS
* service.
*/
public final boolean hasMapOfStringToIntegerList() {
return mapOfStringToIntegerList != null && !(mapOfStringToIntegerList instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the MapOfStringToIntegerList property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* You can use {@link #hasMapOfStringToIntegerList()} to see if a value was sent in this field.
* </p>
*
* @return The value of the MapOfStringToIntegerList property for this object.
*/
public final Map<String, List<Integer>> mapOfStringToIntegerList() {
return mapOfStringToIntegerList;
}
/**
* Returns true if the MapOfStringToString property was specified by the sender (it may be empty), or false if the
* sender did not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS
* service.
*/
public final boolean hasMapOfStringToString() {
return mapOfStringToString != null && !(mapOfStringToString instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the MapOfStringToString property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* You can use {@link #hasMapOfStringToString()} to see if a value was sent in this field.
* </p>
*
* @return The value of the MapOfStringToString property for this object.
*/
public final Map<String, String> mapOfStringToString() {
return mapOfStringToString;
}
/**
* Returns true if the MapOfStringToSimpleStruct property was specified by the sender (it may be empty), or false if
* the sender did not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS
* service.
*/
public final boolean hasMapOfStringToSimpleStruct() {
return mapOfStringToSimpleStruct != null && !(mapOfStringToSimpleStruct instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the MapOfStringToSimpleStruct property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* You can use {@link #hasMapOfStringToSimpleStruct()} to see if a value was sent in this field.
* </p>
*
* @return The value of the MapOfStringToSimpleStruct property for this object.
*/
public final Map<String, SimpleStruct> mapOfStringToSimpleStruct() {
return mapOfStringToSimpleStruct;
}
/**
* Returns the value of the MapOfEnumToEnum property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* You can use {@link #hasMapOfEnumToEnum()} to see if a value was sent in this field.
* </p>
*
* @return The value of the MapOfEnumToEnum property for this object.
*/
public final Map<EnumType, EnumType> mapOfEnumToEnum() {
return MapOfEnumToEnumCopier.copyStringToEnum(mapOfEnumToEnum);
}
/**
* Returns true if the MapOfEnumToEnum property was specified by the sender (it may be empty), or false if the
* sender did not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS
* service.
*/
public final boolean hasMapOfEnumToEnum() {
return mapOfEnumToEnum != null && !(mapOfEnumToEnum instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the MapOfEnumToEnum property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* You can use {@link #hasMapOfEnumToEnum()} to see if a value was sent in this field.
* </p>
*
* @return The value of the MapOfEnumToEnum property for this object.
*/
public final Map<String, String> mapOfEnumToEnumAsStrings() {
return mapOfEnumToEnum;
}
/**
* Returns the value of the MapOfEnumToString property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* You can use {@link #hasMapOfEnumToString()} to see if a value was sent in this field.
* </p>
*
* @return The value of the MapOfEnumToString property for this object.
*/
public final Map<EnumType, String> mapOfEnumToString() {
return MapOfEnumToStringCopier.copyStringToEnum(mapOfEnumToString);
}
/**
* Returns true if the MapOfEnumToString property was specified by the sender (it may be empty), or false if the
* sender did not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS
* service.
*/
public final boolean hasMapOfEnumToString() {
return mapOfEnumToString != null && !(mapOfEnumToString instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the MapOfEnumToString property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* You can use {@link #hasMapOfEnumToString()} to see if a value was sent in this field.
* </p>
*
* @return The value of the MapOfEnumToString property for this object.
*/
public final Map<String, String> mapOfEnumToStringAsStrings() {
return mapOfEnumToString;
}
/**
* Returns the value of the MapOfStringToEnum property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* You can use {@link #hasMapOfStringToEnum()} to see if a value was sent in this field.
* </p>
*
* @return The value of the MapOfStringToEnum property for this object.
*/
public final Map<String, EnumType> mapOfStringToEnum() {
return MapOfStringToEnumCopier.copyStringToEnum(mapOfStringToEnum);
}
/**
* Returns true if the MapOfStringToEnum property was specified by the sender (it may be empty), or false if the
* sender did not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS
* service.
*/
public final boolean hasMapOfStringToEnum() {
return mapOfStringToEnum != null && !(mapOfStringToEnum instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the MapOfStringToEnum property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* You can use {@link #hasMapOfStringToEnum()} to see if a value was sent in this field.
* </p>
*
* @return The value of the MapOfStringToEnum property for this object.
*/
public final Map<String, String> mapOfStringToEnumAsStrings() {
return mapOfStringToEnum;
}
/**
* Returns the value of the MapOfEnumToSimpleStruct property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* You can use {@link #hasMapOfEnumToSimpleStruct()} to see if a value was sent in this field.
* </p>
*
* @return The value of the MapOfEnumToSimpleStruct property for this object.
*/
public final Map<EnumType, SimpleStruct> mapOfEnumToSimpleStruct() {
return MapOfEnumToSimpleStructCopier.copyStringToEnum(mapOfEnumToSimpleStruct);
}
/**
* Returns true if the MapOfEnumToSimpleStruct property was specified by the sender (it may be empty), or false if
* the sender did not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS
* service.
*/
public final boolean hasMapOfEnumToSimpleStruct() {
return mapOfEnumToSimpleStruct != null && !(mapOfEnumToSimpleStruct instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the MapOfEnumToSimpleStruct property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* You can use {@link #hasMapOfEnumToSimpleStruct()} to see if a value was sent in this field.
* </p>
*
* @return The value of the MapOfEnumToSimpleStruct property for this object.
*/
public final Map<String, SimpleStruct> mapOfEnumToSimpleStructAsStrings() {
return mapOfEnumToSimpleStruct;
}
/**
* Returns the value of the MapOfEnumToListOfEnums property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* You can use {@link #hasMapOfEnumToListOfEnums()} to see if a value was sent in this field.
* </p>
*
* @return The value of the MapOfEnumToListOfEnums property for this object.
*/
public final Map<EnumType, List<EnumType>> mapOfEnumToListOfEnums() {
return MapOfEnumToListOfEnumsCopier.copyStringToEnum(mapOfEnumToListOfEnums);
}
/**
* Returns true if the MapOfEnumToListOfEnums property was specified by the sender (it may be empty), or false if
* the sender did not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS
* service.
*/
public final boolean hasMapOfEnumToListOfEnums() {
return mapOfEnumToListOfEnums != null && !(mapOfEnumToListOfEnums instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the MapOfEnumToListOfEnums property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* You can use {@link #hasMapOfEnumToListOfEnums()} to see if a value was sent in this field.
* </p>
*
* @return The value of the MapOfEnumToListOfEnums property for this object.
*/
public final Map<String, List<String>> mapOfEnumToListOfEnumsAsStrings() {
return mapOfEnumToListOfEnums;
}
/**
* Returns the value of the MapOfEnumToMapOfStringToEnum property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* You can use {@link #hasMapOfEnumToMapOfStringToEnum()} to see if a value was sent in this field.
* </p>
*
* @return The value of the MapOfEnumToMapOfStringToEnum property for this object.
*/
public final Map<EnumType, Map<String, EnumType>> mapOfEnumToMapOfStringToEnum() {
return MapOfEnumToMapOfStringToEnumCopier.copyStringToEnum(mapOfEnumToMapOfStringToEnum);
}
/**
* Returns true if the MapOfEnumToMapOfStringToEnum property was specified by the sender (it may be empty), or false
* if the sender did not specify the value (it will be empty). For responses returned by the SDK, the sender is the
* AWS service.
*/
public final boolean hasMapOfEnumToMapOfStringToEnum() {
return mapOfEnumToMapOfStringToEnum != null && !(mapOfEnumToMapOfStringToEnum instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the MapOfEnumToMapOfStringToEnum property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* You can use {@link #hasMapOfEnumToMapOfStringToEnum()} to see if a value was sent in this field.
* </p>
*
* @return The value of the MapOfEnumToMapOfStringToEnum property for this object.
*/
public final Map<String, Map<String, String>> mapOfEnumToMapOfStringToEnumAsStrings() {
return mapOfEnumToMapOfStringToEnum;
}
/**
* Returns the value of the TimestampMember property for this object.
*
* @return The value of the TimestampMember property for this object.
*/
public final Instant timestampMember() {
return timestampMember;
}
/**
* Returns the value of the StructWithNestedTimestampMember property for this object.
*
* @return The value of the StructWithNestedTimestampMember property for this object.
*/
public final StructWithTimestamp structWithNestedTimestampMember() {
return structWithNestedTimestampMember;
}
/**
* Returns the value of the BlobArg property for this object.
*
* @return The value of the BlobArg property for this object.
*/
public final SdkBytes blobArg() {
return blobArg;
}
/**
* Returns the value of the StructWithNestedBlob property for this object.
*
* @return The value of the StructWithNestedBlob property for this object.
*/
public final StructWithNestedBlobType structWithNestedBlob() {
return structWithNestedBlob;
}
/**
* Returns true if the BlobMap property was specified by the sender (it may be empty), or false if the sender did
* not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS service.
*/
public final boolean hasBlobMap() {
return blobMap != null && !(blobMap instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the BlobMap property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* You can use {@link #hasBlobMap()} to see if a value was sent in this field.
* </p>
*
* @return The value of the BlobMap property for this object.
*/
public final Map<String, SdkBytes> blobMap() {
return blobMap;
}
/**
* Returns true if the ListOfBlobs property was specified by the sender (it may be empty), or false if the sender
* did not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS service.
*/
public final boolean hasListOfBlobs() {
return listOfBlobs != null && !(listOfBlobs instanceof SdkAutoConstructList);
}
/**
* Returns the value of the ListOfBlobs property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* You can use {@link #hasListOfBlobs()} to see if a value was sent in this field.
* </p>
*
* @return The value of the ListOfBlobs property for this object.
*/
public final List<SdkBytes> listOfBlobs() {
return listOfBlobs;
}
/**
* Returns the value of the RecursiveStruct property for this object.
*
* @return The value of the RecursiveStruct property for this object.
*/
public final RecursiveStructType recursiveStruct() {
return recursiveStruct;
}
/**
* Returns the value of the PolymorphicTypeWithSubTypes property for this object.
*
* @return The value of the PolymorphicTypeWithSubTypes property for this object.
*/
public final BaseType polymorphicTypeWithSubTypes() {
return polymorphicTypeWithSubTypes;
}
/**
* Returns the value of the PolymorphicTypeWithoutSubTypes property for this object.
*
* @return The value of the PolymorphicTypeWithoutSubTypes property for this object.
*/
public final SubTypeOne polymorphicTypeWithoutSubTypes() {
return polymorphicTypeWithoutSubTypes;
}
/**
* Returns the value of the EnumType property for this object.
* <p>
* If the service returns an enum value that is not available in the current SDK version, {@link #enumType} will
* return {@link EnumType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #enumTypeAsString}.
* </p>
*
* @return The value of the EnumType property for this object.
* @see EnumType
*/
public final EnumType enumType() {
return EnumType.fromValue(enumType);
}
/**
* Returns the value of the EnumType property for this object.
* <p>
* If the service returns an enum value that is not available in the current SDK version, {@link #enumType} will
* return {@link EnumType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #enumTypeAsString}.
* </p>
*
* @return The value of the EnumType property for this object.
* @see EnumType
*/
public final String enumTypeAsString() {
return enumType;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class<? extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
hashCode = 31 * hashCode + Objects.hashCode(stringMember());
hashCode = 31 * hashCode + Objects.hashCode(integerMember());
hashCode = 31 * hashCode + Objects.hashCode(booleanMember());
hashCode = 31 * hashCode + Objects.hashCode(floatMember());
hashCode = 31 * hashCode + Objects.hashCode(doubleMember());
hashCode = 31 * hashCode + Objects.hashCode(longMember());
hashCode = 31 * hashCode + Objects.hashCode(simpleList());
hashCode = 31 * hashCode + Objects.hashCode(listOfEnumsAsStrings());
hashCode = 31 * hashCode + Objects.hashCode(listOfMaps());
hashCode = 31 * hashCode + Objects.hashCode(listOfStructs());
hashCode = 31 * hashCode + Objects.hashCode(listOfMapOfEnumToStringAsStrings());
hashCode = 31 * hashCode + Objects.hashCode(mapOfStringToIntegerList());
hashCode = 31 * hashCode + Objects.hashCode(mapOfStringToString());
hashCode = 31 * hashCode + Objects.hashCode(mapOfStringToSimpleStruct());
hashCode = 31 * hashCode + Objects.hashCode(mapOfEnumToEnumAsStrings());
hashCode = 31 * hashCode + Objects.hashCode(mapOfEnumToStringAsStrings());
hashCode = 31 * hashCode + Objects.hashCode(mapOfStringToEnumAsStrings());
hashCode = 31 * hashCode + Objects.hashCode(mapOfEnumToSimpleStructAsStrings());
hashCode = 31 * hashCode + Objects.hashCode(mapOfEnumToListOfEnumsAsStrings());
hashCode = 31 * hashCode + Objects.hashCode(mapOfEnumToMapOfStringToEnumAsStrings());
hashCode = 31 * hashCode + Objects.hashCode(timestampMember());
hashCode = 31 * hashCode + Objects.hashCode(structWithNestedTimestampMember());
hashCode = 31 * hashCode + Objects.hashCode(blobArg());
hashCode = 31 * hashCode + Objects.hashCode(structWithNestedBlob());
hashCode = 31 * hashCode + Objects.hashCode(blobMap());
hashCode = 31 * hashCode + Objects.hashCode(listOfBlobs());
hashCode = 31 * hashCode + Objects.hashCode(recursiveStruct());
hashCode = 31 * hashCode + Objects.hashCode(polymorphicTypeWithSubTypes());
hashCode = 31 * hashCode + Objects.hashCode(polymorphicTypeWithoutSubTypes());
hashCode = 31 * hashCode + Objects.hashCode(enumTypeAsString());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof AllTypesRequest)) {
return false;
}
AllTypesRequest other = (AllTypesRequest) obj;
return Objects.equals(stringMember(), other.stringMember()) && Objects.equals(integerMember(), other.integerMember())
&& Objects.equals(booleanMember(), other.booleanMember()) && Objects.equals(floatMember(), other.floatMember())
&& Objects.equals(doubleMember(), other.doubleMember()) && Objects.equals(longMember(), other.longMember())
&& Objects.equals(simpleList(), other.simpleList())
&& Objects.equals(listOfEnumsAsStrings(), other.listOfEnumsAsStrings())
&& Objects.equals(listOfMaps(), other.listOfMaps()) && Objects.equals(listOfStructs(), other.listOfStructs())
&& Objects.equals(listOfMapOfEnumToStringAsStrings(), other.listOfMapOfEnumToStringAsStrings())
&& Objects.equals(mapOfStringToIntegerList(), other.mapOfStringToIntegerList())
&& Objects.equals(mapOfStringToString(), other.mapOfStringToString())
&& Objects.equals(mapOfStringToSimpleStruct(), other.mapOfStringToSimpleStruct())
&& Objects.equals(mapOfEnumToEnumAsStrings(), other.mapOfEnumToEnumAsStrings())
&& Objects.equals(mapOfEnumToStringAsStrings(), other.mapOfEnumToStringAsStrings())
&& Objects.equals(mapOfStringToEnumAsStrings(), other.mapOfStringToEnumAsStrings())
&& Objects.equals(mapOfEnumToSimpleStructAsStrings(), other.mapOfEnumToSimpleStructAsStrings())
&& Objects.equals(mapOfEnumToListOfEnumsAsStrings(), other.mapOfEnumToListOfEnumsAsStrings())
&& Objects.equals(mapOfEnumToMapOfStringToEnumAsStrings(), other.mapOfEnumToMapOfStringToEnumAsStrings())
&& Objects.equals(timestampMember(), other.timestampMember())
&& Objects.equals(structWithNestedTimestampMember(), other.structWithNestedTimestampMember())
&& Objects.equals(blobArg(), other.blobArg())
&& Objects.equals(structWithNestedBlob(), other.structWithNestedBlob())
&& Objects.equals(blobMap(), other.blobMap()) && Objects.equals(listOfBlobs(), other.listOfBlobs())
&& Objects.equals(recursiveStruct(), other.recursiveStruct())
&& Objects.equals(polymorphicTypeWithSubTypes(), other.polymorphicTypeWithSubTypes())
&& Objects.equals(polymorphicTypeWithoutSubTypes(), other.polymorphicTypeWithoutSubTypes())
&& Objects.equals(enumTypeAsString(), other.enumTypeAsString());
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("AllTypesRequest").add("StringMember", stringMember()).add("IntegerMember", integerMember())
.add("BooleanMember", booleanMember()).add("FloatMember", floatMember()).add("DoubleMember", doubleMember())
.add("LongMember", longMember()).add("SimpleList", simpleList()).add("ListOfEnums", listOfEnumsAsStrings())
.add("ListOfMaps", listOfMaps()).add("ListOfStructs", listOfStructs())
.add("ListOfMapOfEnumToString", listOfMapOfEnumToStringAsStrings())
.add("MapOfStringToIntegerList", mapOfStringToIntegerList()).add("MapOfStringToString", mapOfStringToString())
.add("MapOfStringToSimpleStruct", mapOfStringToSimpleStruct()).add("MapOfEnumToEnum", mapOfEnumToEnumAsStrings())
.add("MapOfEnumToString", mapOfEnumToStringAsStrings()).add("MapOfStringToEnum", mapOfStringToEnumAsStrings())
.add("MapOfEnumToSimpleStruct", mapOfEnumToSimpleStructAsStrings())
.add("MapOfEnumToListOfEnums", mapOfEnumToListOfEnumsAsStrings())
.add("MapOfEnumToMapOfStringToEnum", mapOfEnumToMapOfStringToEnumAsStrings())
.add("TimestampMember", timestampMember())
.add("StructWithNestedTimestampMember", structWithNestedTimestampMember()).add("BlobArg", blobArg())
.add("StructWithNestedBlob", structWithNestedBlob()).add("BlobMap", blobMap()).add("ListOfBlobs", listOfBlobs())
.add("RecursiveStruct", recursiveStruct()).add("PolymorphicTypeWithSubTypes", polymorphicTypeWithSubTypes())
.add("PolymorphicTypeWithoutSubTypes", polymorphicTypeWithoutSubTypes()).add("EnumType", enumTypeAsString())
.build();
}
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
switch (fieldName) {
case "StringMember":
return Optional.ofNullable(clazz.cast(stringMember()));
case "IntegerMember":
return Optional.ofNullable(clazz.cast(integerMember()));
case "BooleanMember":
return Optional.ofNullable(clazz.cast(booleanMember()));
case "FloatMember":
return Optional.ofNullable(clazz.cast(floatMember()));
case "DoubleMember":
return Optional.ofNullable(clazz.cast(doubleMember()));
case "LongMember":
return Optional.ofNullable(clazz.cast(longMember()));
case "SimpleList":
return Optional.ofNullable(clazz.cast(simpleList()));
case "ListOfEnums":
return Optional.ofNullable(clazz.cast(listOfEnumsAsStrings()));
case "ListOfMaps":
return Optional.ofNullable(clazz.cast(listOfMaps()));
case "ListOfStructs":
return Optional.ofNullable(clazz.cast(listOfStructs()));
case "ListOfMapOfEnumToString":
return Optional.ofNullable(clazz.cast(listOfMapOfEnumToStringAsStrings()));
case "MapOfStringToIntegerList":
return Optional.ofNullable(clazz.cast(mapOfStringToIntegerList()));
case "MapOfStringToString":
return Optional.ofNullable(clazz.cast(mapOfStringToString()));
case "MapOfStringToSimpleStruct":
return Optional.ofNullable(clazz.cast(mapOfStringToSimpleStruct()));
case "MapOfEnumToEnum":
return Optional.ofNullable(clazz.cast(mapOfEnumToEnumAsStrings()));
case "MapOfEnumToString":
return Optional.ofNullable(clazz.cast(mapOfEnumToStringAsStrings()));
case "MapOfStringToEnum":
return Optional.ofNullable(clazz.cast(mapOfStringToEnumAsStrings()));
case "MapOfEnumToSimpleStruct":
return Optional.ofNullable(clazz.cast(mapOfEnumToSimpleStructAsStrings()));
case "MapOfEnumToListOfEnums":
return Optional.ofNullable(clazz.cast(mapOfEnumToListOfEnumsAsStrings()));
case "MapOfEnumToMapOfStringToEnum":
return Optional.ofNullable(clazz.cast(mapOfEnumToMapOfStringToEnumAsStrings()));
case "TimestampMember":
return Optional.ofNullable(clazz.cast(timestampMember()));
case "StructWithNestedTimestampMember":
return Optional.ofNullable(clazz.cast(structWithNestedTimestampMember()));
case "BlobArg":
return Optional.ofNullable(clazz.cast(blobArg()));
case "StructWithNestedBlob":
return Optional.ofNullable(clazz.cast(structWithNestedBlob()));
case "BlobMap":
return Optional.ofNullable(clazz.cast(blobMap()));
case "ListOfBlobs":
return Optional.ofNullable(clazz.cast(listOfBlobs()));
case "RecursiveStruct":
return Optional.ofNullable(clazz.cast(recursiveStruct()));
case "PolymorphicTypeWithSubTypes":
return Optional.ofNullable(clazz.cast(polymorphicTypeWithSubTypes()));
case "PolymorphicTypeWithoutSubTypes":
return Optional.ofNullable(clazz.cast(polymorphicTypeWithoutSubTypes()));
case "EnumType":
return Optional.ofNullable(clazz.cast(enumTypeAsString()));
default:
return Optional.empty();
}
}
@Override
public final List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
private static <T> Function<Object, T> getter(Function<AllTypesRequest, T> g) {
return obj -> g.apply((AllTypesRequest) obj);
}
private static <T> BiConsumer<Object, T> setter(BiConsumer<Builder, T> s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
public interface Builder extends JsonProtocolTestsRequest.Builder, SdkPojo, CopyableBuilder<Builder, AllTypesRequest> {
/**
* Sets the value of the StringMember property for this object.
*
* @param stringMember
* The new value for the StringMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder stringMember(String stringMember);
/**
* Sets the value of the IntegerMember property for this object.
*
* @param integerMember
* The new value for the IntegerMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder integerMember(Integer integerMember);
/**
* Sets the value of the BooleanMember property for this object.
*
* @param booleanMember
* The new value for the BooleanMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder booleanMember(Boolean booleanMember);
/**
* Sets the value of the FloatMember property for this object.
*
* @param floatMember
* The new value for the FloatMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder floatMember(Float floatMember);
/**
* Sets the value of the DoubleMember property for this object.
*
* @param doubleMember
* The new value for the DoubleMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder doubleMember(Double doubleMember);
/**
* Sets the value of the LongMember property for this object.
*
* @param longMember
* The new value for the LongMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder longMember(Long longMember);
/**
* Sets the value of the SimpleList property for this object.
*
* @param simpleList
* The new value for the SimpleList property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder simpleList(Collection<String> simpleList);
/**
* Sets the value of the SimpleList property for this object.
*
* @param simpleList
* The new value for the SimpleList property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder simpleList(String... simpleList);
/**
* Sets the value of the ListOfEnums property for this object.
*
* @param listOfEnums
* The new value for the ListOfEnums property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfEnumsWithStrings(Collection<String> listOfEnums);
/**
* Sets the value of the ListOfEnums property for this object.
*
* @param listOfEnums
* The new value for the ListOfEnums property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfEnumsWithStrings(String... listOfEnums);
/**
* Sets the value of the ListOfEnums property for this object.
*
* @param listOfEnums
* The new value for the ListOfEnums property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfEnums(Collection<EnumType> listOfEnums);
/**
* Sets the value of the ListOfEnums property for this object.
*
* @param listOfEnums
* The new value for the ListOfEnums property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfEnums(EnumType... listOfEnums);
/**
* Sets the value of the ListOfMaps property for this object.
*
* @param listOfMaps
* The new value for the ListOfMaps property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfMaps(Collection<? extends Map<String, String>> listOfMaps);
/**
* Sets the value of the ListOfMaps property for this object.
*
* @param listOfMaps
* The new value for the ListOfMaps property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfMaps(Map<String, String>... listOfMaps);
/**
* Sets the value of the ListOfStructs property for this object.
*
* @param listOfStructs
* The new value for the ListOfStructs property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfStructs(Collection<SimpleStruct> listOfStructs);
/**
* Sets the value of the ListOfStructs property for this object.
*
* @param listOfStructs
* The new value for the ListOfStructs property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfStructs(SimpleStruct... listOfStructs);
/**
* Sets the value of the ListOfStructs property for this object.
*
* This is a convenience that creates an instance of the {@link List<SimpleStruct>.Builder} avoiding the need to
* create one manually via {@link List<SimpleStruct>#builder()}.
*
* When the {@link Consumer} completes, {@link List<SimpleStruct>.Builder#build()} is called immediately and its
* result is passed to {@link #listOfStructs(List<SimpleStruct>)}.
*
* @param listOfStructs
* a consumer that will call methods on {@link List<SimpleStruct>.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #listOfStructs(List<SimpleStruct>)
*/
Builder listOfStructs(Consumer<SimpleStruct.Builder>... listOfStructs);
/**
* Sets the value of the ListOfMapOfEnumToString property for this object.
*
* @param listOfMapOfEnumToString
* The new value for the ListOfMapOfEnumToString property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfMapOfEnumToStringWithStrings(Collection<? extends Map<String, String>> listOfMapOfEnumToString);
/**
* Sets the value of the ListOfMapOfEnumToString property for this object.
*
* @param listOfMapOfEnumToString
* The new value for the ListOfMapOfEnumToString property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfMapOfEnumToStringWithStrings(Map<String, String>... listOfMapOfEnumToString);
/**
* Sets the value of the MapOfStringToIntegerList property for this object.
*
* @param mapOfStringToIntegerList
* The new value for the MapOfStringToIntegerList property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfStringToIntegerList(Map<String, ? extends Collection<Integer>> mapOfStringToIntegerList);
/**
* Sets the value of the MapOfStringToString property for this object.
*
* @param mapOfStringToString
* The new value for the MapOfStringToString property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfStringToString(Map<String, String> mapOfStringToString);
/**
* Sets the value of the MapOfStringToSimpleStruct property for this object.
*
* @param mapOfStringToSimpleStruct
* The new value for the MapOfStringToSimpleStruct property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfStringToSimpleStruct(Map<String, SimpleStruct> mapOfStringToSimpleStruct);
/**
* Sets the value of the MapOfEnumToEnum property for this object.
*
* @param mapOfEnumToEnum
* The new value for the MapOfEnumToEnum property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfEnumToEnumWithStrings(Map<String, String> mapOfEnumToEnum);
/**
* Sets the value of the MapOfEnumToEnum property for this object.
*
* @param mapOfEnumToEnum
* The new value for the MapOfEnumToEnum property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfEnumToEnum(Map<EnumType, EnumType> mapOfEnumToEnum);
/**
* Sets the value of the MapOfEnumToString property for this object.
*
* @param mapOfEnumToString
* The new value for the MapOfEnumToString property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfEnumToStringWithStrings(Map<String, String> mapOfEnumToString);
/**
* Sets the value of the MapOfEnumToString property for this object.
*
* @param mapOfEnumToString
* The new value for the MapOfEnumToString property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfEnumToString(Map<EnumType, String> mapOfEnumToString);
/**
* Sets the value of the MapOfStringToEnum property for this object.
*
* @param mapOfStringToEnum
* The new value for the MapOfStringToEnum property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfStringToEnumWithStrings(Map<String, String> mapOfStringToEnum);
/**
* Sets the value of the MapOfStringToEnum property for this object.
*
* @param mapOfStringToEnum
* The new value for the MapOfStringToEnum property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfStringToEnum(Map<String, EnumType> mapOfStringToEnum);
/**
* Sets the value of the MapOfEnumToSimpleStruct property for this object.
*
* @param mapOfEnumToSimpleStruct
* The new value for the MapOfEnumToSimpleStruct property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfEnumToSimpleStructWithStrings(Map<String, SimpleStruct> mapOfEnumToSimpleStruct);
/**
* Sets the value of the MapOfEnumToSimpleStruct property for this object.
*
* @param mapOfEnumToSimpleStruct
* The new value for the MapOfEnumToSimpleStruct property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfEnumToSimpleStruct(Map<EnumType, SimpleStruct> mapOfEnumToSimpleStruct);
/**
* Sets the value of the MapOfEnumToListOfEnums property for this object.
*
* @param mapOfEnumToListOfEnums
* The new value for the MapOfEnumToListOfEnums property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfEnumToListOfEnumsWithStrings(Map<String, ? extends Collection<String>> mapOfEnumToListOfEnums);
/**
* Sets the value of the MapOfEnumToListOfEnums property for this object.
*
* @param mapOfEnumToListOfEnums
* The new value for the MapOfEnumToListOfEnums property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfEnumToListOfEnums(Map<EnumType, ? extends Collection<EnumType>> mapOfEnumToListOfEnums);
/**
* Sets the value of the MapOfEnumToMapOfStringToEnum property for this object.
*
* @param mapOfEnumToMapOfStringToEnum
* The new value for the MapOfEnumToMapOfStringToEnum property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfEnumToMapOfStringToEnumWithStrings(Map<String, Map<String, String>> mapOfEnumToMapOfStringToEnum);
/**
* Sets the value of the MapOfEnumToMapOfStringToEnum property for this object.
*
* @param mapOfEnumToMapOfStringToEnum
* The new value for the MapOfEnumToMapOfStringToEnum property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfEnumToMapOfStringToEnum(Map<EnumType, Map<String, EnumType>> mapOfEnumToMapOfStringToEnum);
/**
* Sets the value of the TimestampMember property for this object.
*
* @param timestampMember
* The new value for the TimestampMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder timestampMember(Instant timestampMember);
/**
* Sets the value of the StructWithNestedTimestampMember property for this object.
*
* @param structWithNestedTimestampMember
* The new value for the StructWithNestedTimestampMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder structWithNestedTimestampMember(StructWithTimestamp structWithNestedTimestampMember);
/**
* Sets the value of the StructWithNestedTimestampMember property for this object.
*
* This is a convenience that creates an instance of the {@link StructWithTimestamp.Builder} avoiding the need
* to create one manually via {@link StructWithTimestamp#builder()}.
*
* When the {@link Consumer} completes, {@link StructWithTimestamp.Builder#build()} is called immediately and
* its result is passed to {@link #structWithNestedTimestampMember(StructWithTimestamp)}.
*
* @param structWithNestedTimestampMember
* a consumer that will call methods on {@link StructWithTimestamp.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #structWithNestedTimestampMember(StructWithTimestamp)
*/
default Builder structWithNestedTimestampMember(Consumer<StructWithTimestamp.Builder> structWithNestedTimestampMember) {
return structWithNestedTimestampMember(StructWithTimestamp.builder().applyMutation(structWithNestedTimestampMember)
.build());
}
/**
* Sets the value of the BlobArg property for this object.
*
* @param blobArg
* The new value for the BlobArg property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder blobArg(SdkBytes blobArg);
/**
* Sets the value of the StructWithNestedBlob property for this object.
*
* @param structWithNestedBlob
* The new value for the StructWithNestedBlob property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder structWithNestedBlob(StructWithNestedBlobType structWithNestedBlob);
/**
* Sets the value of the StructWithNestedBlob property for this object.
*
* This is a convenience that creates an instance of the {@link StructWithNestedBlobType.Builder} avoiding the
* need to create one manually via {@link StructWithNestedBlobType#builder()}.
*
* When the {@link Consumer} completes, {@link StructWithNestedBlobType.Builder#build()} is called immediately
* and its result is passed to {@link #structWithNestedBlob(StructWithNestedBlobType)}.
*
* @param structWithNestedBlob
* a consumer that will call methods on {@link StructWithNestedBlobType.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #structWithNestedBlob(StructWithNestedBlobType)
*/
default Builder structWithNestedBlob(Consumer<StructWithNestedBlobType.Builder> structWithNestedBlob) {
return structWithNestedBlob(StructWithNestedBlobType.builder().applyMutation(structWithNestedBlob).build());
}
/**
* Sets the value of the BlobMap property for this object.
*
* @param blobMap
* The new value for the BlobMap property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder blobMap(Map<String, SdkBytes> blobMap);
/**
* Sets the value of the ListOfBlobs property for this object.
*
* @param listOfBlobs
* The new value for the ListOfBlobs property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfBlobs(Collection<SdkBytes> listOfBlobs);
/**
* Sets the value of the ListOfBlobs property for this object.
*
* @param listOfBlobs
* The new value for the ListOfBlobs property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfBlobs(SdkBytes... listOfBlobs);
/**
* Sets the value of the RecursiveStruct property for this object.
*
* @param recursiveStruct
* The new value for the RecursiveStruct property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder recursiveStruct(RecursiveStructType recursiveStruct);
/**
* Sets the value of the RecursiveStruct property for this object.
*
* This is a convenience that creates an instance of the {@link RecursiveStructType.Builder} avoiding the need
* to create one manually via {@link RecursiveStructType#builder()}.
*
* When the {@link Consumer} completes, {@link RecursiveStructType.Builder#build()} is called immediately and
* its result is passed to {@link #recursiveStruct(RecursiveStructType)}.
*
* @param recursiveStruct
* a consumer that will call methods on {@link RecursiveStructType.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #recursiveStruct(RecursiveStructType)
*/
default Builder recursiveStruct(Consumer<RecursiveStructType.Builder> recursiveStruct) {
return recursiveStruct(RecursiveStructType.builder().applyMutation(recursiveStruct).build());
}
/**
* Sets the value of the PolymorphicTypeWithSubTypes property for this object.
*
* @param polymorphicTypeWithSubTypes
* The new value for the PolymorphicTypeWithSubTypes property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder polymorphicTypeWithSubTypes(BaseType polymorphicTypeWithSubTypes);
/**
* Sets the value of the PolymorphicTypeWithSubTypes property for this object.
*
* This is a convenience that creates an instance of the {@link BaseType.Builder} avoiding the need to create
* one manually via {@link BaseType#builder()}.
*
* When the {@link Consumer} completes, {@link BaseType.Builder#build()} is called immediately and its result is
* passed to {@link #polymorphicTypeWithSubTypes(BaseType)}.
*
* @param polymorphicTypeWithSubTypes
* a consumer that will call methods on {@link BaseType.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #polymorphicTypeWithSubTypes(BaseType)
*/
default Builder polymorphicTypeWithSubTypes(Consumer<BaseType.Builder> polymorphicTypeWithSubTypes) {
return polymorphicTypeWithSubTypes(BaseType.builder().applyMutation(polymorphicTypeWithSubTypes).build());
}
/**
* Sets the value of the PolymorphicTypeWithoutSubTypes property for this object.
*
* @param polymorphicTypeWithoutSubTypes
* The new value for the PolymorphicTypeWithoutSubTypes property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder polymorphicTypeWithoutSubTypes(SubTypeOne polymorphicTypeWithoutSubTypes);
/**
* Sets the value of the PolymorphicTypeWithoutSubTypes property for this object.
*
* This is a convenience that creates an instance of the {@link SubTypeOne.Builder} avoiding the need to create
* one manually via {@link SubTypeOne#builder()}.
*
* When the {@link Consumer} completes, {@link SubTypeOne.Builder#build()} is called immediately and its result
* is passed to {@link #polymorphicTypeWithoutSubTypes(SubTypeOne)}.
*
* @param polymorphicTypeWithoutSubTypes
* a consumer that will call methods on {@link SubTypeOne.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #polymorphicTypeWithoutSubTypes(SubTypeOne)
*/
default Builder polymorphicTypeWithoutSubTypes(Consumer<SubTypeOne.Builder> polymorphicTypeWithoutSubTypes) {
return polymorphicTypeWithoutSubTypes(SubTypeOne.builder().applyMutation(polymorphicTypeWithoutSubTypes).build());
}
/**
* Sets the value of the EnumType property for this object.
*
* @param enumType
* The new value for the EnumType property for this object.
* @see EnumType
* @return Returns a reference to this object so that method calls can be chained together.
* @see EnumType
*/
Builder enumType(String enumType);
/**
* Sets the value of the EnumType property for this object.
*
* @param enumType
* The new value for the EnumType property for this object.
* @see EnumType
* @return Returns a reference to this object so that method calls can be chained together.
* @see EnumType
*/
Builder enumType(EnumType enumType);
@Override
Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration);
@Override
Builder overrideConfiguration(Consumer<AwsRequestOverrideConfiguration.Builder> builderConsumer);
}
static final class BuilderImpl extends JsonProtocolTestsRequest.BuilderImpl implements Builder {
private String stringMember;
private Integer integerMember;
private Boolean booleanMember;
private Float floatMember;
private Double doubleMember;
private Long longMember;
private List<String> simpleList;
private List<String> listOfEnums;
private List<Map<String, String>> listOfMaps;
private List<SimpleStruct> listOfStructs;
private List<Map<String, String>> listOfMapOfEnumToString;
private Map<String, List<Integer>> mapOfStringToIntegerList;
private Map<String, String> mapOfStringToString;
private Map<String, SimpleStruct> mapOfStringToSimpleStruct;
private Map<String, String> mapOfEnumToEnum;
private Map<String, String> mapOfEnumToString;
private Map<String, String> mapOfStringToEnum;
private Map<String, SimpleStruct> mapOfEnumToSimpleStruct;
private Map<String, List<String>> mapOfEnumToListOfEnums;
private Map<String, Map<String, String>> mapOfEnumToMapOfStringToEnum;
private Instant timestampMember;
private StructWithTimestamp structWithNestedTimestampMember;
private SdkBytes blobArg;
private StructWithNestedBlobType structWithNestedBlob;
private Map<String, SdkBytes> blobMap;
private List<SdkBytes> listOfBlobs;
private RecursiveStructType recursiveStruct;
private BaseType polymorphicTypeWithSubTypes;
private SubTypeOne polymorphicTypeWithoutSubTypes;
private String enumType;
private BuilderImpl() {
}
private BuilderImpl(AllTypesRequest model) {
super(model);
stringMember(model.stringMember);
integerMember(model.integerMember);
booleanMember(model.booleanMember);
floatMember(model.floatMember);
doubleMember(model.doubleMember);
longMember(model.longMember);
simpleList(model.simpleList);
listOfEnumsWithStrings(model.listOfEnums);
listOfMaps(model.listOfMaps);
listOfStructs(model.listOfStructs);
listOfMapOfEnumToStringWithStrings(model.listOfMapOfEnumToString);
mapOfStringToIntegerList(model.mapOfStringToIntegerList);
mapOfStringToString(model.mapOfStringToString);
mapOfStringToSimpleStruct(model.mapOfStringToSimpleStruct);
mapOfEnumToEnumWithStrings(model.mapOfEnumToEnum);
mapOfEnumToStringWithStrings(model.mapOfEnumToString);
mapOfStringToEnumWithStrings(model.mapOfStringToEnum);
mapOfEnumToSimpleStructWithStrings(model.mapOfEnumToSimpleStruct);
mapOfEnumToListOfEnumsWithStrings(model.mapOfEnumToListOfEnums);
mapOfEnumToMapOfStringToEnumWithStrings(model.mapOfEnumToMapOfStringToEnum);
timestampMember(model.timestampMember);
structWithNestedTimestampMember(model.structWithNestedTimestampMember);
blobArg(model.blobArg);
structWithNestedBlob(model.structWithNestedBlob);
blobMap(model.blobMap);
listOfBlobs(model.listOfBlobs);
recursiveStruct(model.recursiveStruct);
polymorphicTypeWithSubTypes(model.polymorphicTypeWithSubTypes);
polymorphicTypeWithoutSubTypes(model.polymorphicTypeWithoutSubTypes);
enumType(model.enumType);
}
public final String getStringMember() {
return stringMember;
}
@Override
public final Builder stringMember(String stringMember) {
this.stringMember = stringMember;
return this;
}
public final void setStringMember(String stringMember) {
this.stringMember = stringMember;
}
public final Integer getIntegerMember() {
return integerMember;
}
@Override
public final Builder integerMember(Integer integerMember) {
this.integerMember = integerMember;
return this;
}
public final void setIntegerMember(Integer integerMember) {
this.integerMember = integerMember;
}
public final Boolean getBooleanMember() {
return booleanMember;
}
@Override
public final Builder booleanMember(Boolean booleanMember) {
this.booleanMember = booleanMember;
return this;
}
public final void setBooleanMember(Boolean booleanMember) {
this.booleanMember = booleanMember;
}
public final Float getFloatMember() {
return floatMember;
}
@Override
public final Builder floatMember(Float floatMember) {
this.floatMember = floatMember;
return this;
}
public final void setFloatMember(Float floatMember) {
this.floatMember = floatMember;
}
public final Double getDoubleMember() {
return doubleMember;
}
@Override
public final Builder doubleMember(Double doubleMember) {
this.doubleMember = doubleMember;
return this;
}
public final void setDoubleMember(Double doubleMember) {
this.doubleMember = doubleMember;
}
public final Long getLongMember() {
return longMember;
}
@Override
public final Builder longMember(Long longMember) {
this.longMember = longMember;
return this;
}
public final void setLongMember(Long longMember) {
this.longMember = longMember;
}
public final Collection<String> getSimpleList() {
return simpleList;
}
@Override
public final Builder simpleList(Collection<String> simpleList) {
this.simpleList = ListOfStringsCopier.copy(simpleList);
return this;
}
@Override
@SafeVarargs
public final Builder simpleList(String... simpleList) {
simpleList(Arrays.asList(simpleList));
return this;
}
public final void setSimpleList(Collection<String> simpleList) {
this.simpleList = ListOfStringsCopier.copy(simpleList);
}
public final Collection<String> getListOfEnums() {
return listOfEnums;
}
@Override
public final Builder listOfEnumsWithStrings(Collection<String> listOfEnums) {
this.listOfEnums = ListOfEnumsCopier.copy(listOfEnums);
return this;
}
@Override
@SafeVarargs
public final Builder listOfEnumsWithStrings(String... listOfEnums) {
listOfEnumsWithStrings(Arrays.asList(listOfEnums));
return this;
}
@Override
public final Builder listOfEnums(Collection<EnumType> listOfEnums) {
this.listOfEnums = ListOfEnumsCopier.copyEnumToString(listOfEnums);
return this;
}
@Override
@SafeVarargs
public final Builder listOfEnums(EnumType... listOfEnums) {
listOfEnums(Arrays.asList(listOfEnums));
return this;
}
public final void setListOfEnums(Collection<String> listOfEnums) {
this.listOfEnums = ListOfEnumsCopier.copy(listOfEnums);
}
public final Collection<? extends Map<String, String>> getListOfMaps() {
return listOfMaps;
}
@Override
public final Builder listOfMaps(Collection<? extends Map<String, String>> listOfMaps) {
this.listOfMaps = ListOfMapStringToStringCopier.copy(listOfMaps);
return this;
}
@Override
@SafeVarargs
public final Builder listOfMaps(Map<String, String>... listOfMaps) {
listOfMaps(Arrays.asList(listOfMaps));
return this;
}
public final void setListOfMaps(Collection<? extends Map<String, String>> listOfMaps) {
this.listOfMaps = ListOfMapStringToStringCopier.copy(listOfMaps);
}
public final Collection<SimpleStruct.Builder> getListOfStructs() {
return listOfStructs != null ? listOfStructs.stream().map(SimpleStruct::toBuilder).collect(Collectors.toList())
: null;
}
@Override
public final Builder listOfStructs(Collection<SimpleStruct> listOfStructs) {
this.listOfStructs = ListOfSimpleStructsCopier.copy(listOfStructs);
return this;
}
@Override
@SafeVarargs
public final Builder listOfStructs(SimpleStruct... listOfStructs) {
listOfStructs(Arrays.asList(listOfStructs));
return this;
}
@Override
@SafeVarargs
public final Builder listOfStructs(Consumer<SimpleStruct.Builder>... listOfStructs) {
listOfStructs(Stream.of(listOfStructs).map(c -> SimpleStruct.builder().applyMutation(c).build())
.collect(Collectors.toList()));
return this;
}
public final void setListOfStructs(Collection<SimpleStruct.BuilderImpl> listOfStructs) {
this.listOfStructs = ListOfSimpleStructsCopier.copyFromBuilder(listOfStructs);
}
public final Collection<? extends Map<String, String>> getListOfMapOfEnumToString() {
return listOfMapOfEnumToString;
}
@Override
public final Builder listOfMapOfEnumToStringWithStrings(Collection<? extends Map<String, String>> listOfMapOfEnumToString) {
this.listOfMapOfEnumToString = ListOfMapOfEnumToStringCopier.copy(listOfMapOfEnumToString);
return this;
}
@Override
@SafeVarargs
public final Builder listOfMapOfEnumToStringWithStrings(Map<String, String>... listOfMapOfEnumToString) {
listOfMapOfEnumToStringWithStrings(Arrays.asList(listOfMapOfEnumToString));
return this;
}
public final void setListOfMapOfEnumToString(Collection<? extends Map<String, String>> listOfMapOfEnumToString) {
this.listOfMapOfEnumToString = ListOfMapOfEnumToStringCopier.copy(listOfMapOfEnumToString);
}
public final Map<String, ? extends Collection<Integer>> getMapOfStringToIntegerList() {
return mapOfStringToIntegerList;
}
@Override
public final Builder mapOfStringToIntegerList(Map<String, ? extends Collection<Integer>> mapOfStringToIntegerList) {
this.mapOfStringToIntegerList = MapOfStringToIntegerListCopier.copy(mapOfStringToIntegerList);
return this;
}
public final void setMapOfStringToIntegerList(Map<String, ? extends Collection<Integer>> mapOfStringToIntegerList) {
this.mapOfStringToIntegerList = MapOfStringToIntegerListCopier.copy(mapOfStringToIntegerList);
}
public final Map<String, String> getMapOfStringToString() {
return mapOfStringToString;
}
@Override
public final Builder mapOfStringToString(Map<String, String> mapOfStringToString) {
this.mapOfStringToString = MapOfStringToStringCopier.copy(mapOfStringToString);
return this;
}
public final void setMapOfStringToString(Map<String, String> mapOfStringToString) {
this.mapOfStringToString = MapOfStringToStringCopier.copy(mapOfStringToString);
}
public final Map<String, SimpleStruct.Builder> getMapOfStringToSimpleStruct() {
return mapOfStringToSimpleStruct != null ? CollectionUtils.mapValues(mapOfStringToSimpleStruct,
SimpleStruct::toBuilder) : null;
}
@Override
public final Builder mapOfStringToSimpleStruct(Map<String, SimpleStruct> mapOfStringToSimpleStruct) {
this.mapOfStringToSimpleStruct = MapOfStringToSimpleStructCopier.copy(mapOfStringToSimpleStruct);
return this;
}
public final void setMapOfStringToSimpleStruct(Map<String, SimpleStruct.BuilderImpl> mapOfStringToSimpleStruct) {
this.mapOfStringToSimpleStruct = MapOfStringToSimpleStructCopier.copyFromBuilder(mapOfStringToSimpleStruct);
}
public final Map<String, String> getMapOfEnumToEnum() {
return mapOfEnumToEnum;
}
@Override
public final Builder mapOfEnumToEnumWithStrings(Map<String, String> mapOfEnumToEnum) {
this.mapOfEnumToEnum = MapOfEnumToEnumCopier.copy(mapOfEnumToEnum);
return this;
}
@Override
public final Builder mapOfEnumToEnum(Map<EnumType, EnumType> mapOfEnumToEnum) {
this.mapOfEnumToEnum = MapOfEnumToEnumCopier.copyEnumToString(mapOfEnumToEnum);
return this;
}
public final void setMapOfEnumToEnum(Map<String, String> mapOfEnumToEnum) {
this.mapOfEnumToEnum = MapOfEnumToEnumCopier.copy(mapOfEnumToEnum);
}
public final Map<String, String> getMapOfEnumToString() {
return mapOfEnumToString;
}
@Override
public final Builder mapOfEnumToStringWithStrings(Map<String, String> mapOfEnumToString) {
this.mapOfEnumToString = MapOfEnumToStringCopier.copy(mapOfEnumToString);
return this;
}
@Override
public final Builder mapOfEnumToString(Map<EnumType, String> mapOfEnumToString) {
this.mapOfEnumToString = MapOfEnumToStringCopier.copyEnumToString(mapOfEnumToString);
return this;
}
public final void setMapOfEnumToString(Map<String, String> mapOfEnumToString) {
this.mapOfEnumToString = MapOfEnumToStringCopier.copy(mapOfEnumToString);
}
public final Map<String, String> getMapOfStringToEnum() {
return mapOfStringToEnum;
}
@Override
public final Builder mapOfStringToEnumWithStrings(Map<String, String> mapOfStringToEnum) {
this.mapOfStringToEnum = MapOfStringToEnumCopier.copy(mapOfStringToEnum);
return this;
}
@Override
public final Builder mapOfStringToEnum(Map<String, EnumType> mapOfStringToEnum) {
this.mapOfStringToEnum = MapOfStringToEnumCopier.copyEnumToString(mapOfStringToEnum);
return this;
}
public final void setMapOfStringToEnum(Map<String, String> mapOfStringToEnum) {
this.mapOfStringToEnum = MapOfStringToEnumCopier.copy(mapOfStringToEnum);
}
public final Map<String, SimpleStruct.Builder> getMapOfEnumToSimpleStruct() {
return mapOfEnumToSimpleStruct != null ? CollectionUtils.mapValues(mapOfEnumToSimpleStruct, SimpleStruct::toBuilder)
: null;
}
@Override
public final Builder mapOfEnumToSimpleStructWithStrings(Map<String, SimpleStruct> mapOfEnumToSimpleStruct) {
this.mapOfEnumToSimpleStruct = MapOfEnumToSimpleStructCopier.copy(mapOfEnumToSimpleStruct);
return this;
}
@Override
public final Builder mapOfEnumToSimpleStruct(Map<EnumType, SimpleStruct> mapOfEnumToSimpleStruct) {
this.mapOfEnumToSimpleStruct = MapOfEnumToSimpleStructCopier.copyEnumToString(mapOfEnumToSimpleStruct);
return this;
}
public final void setMapOfEnumToSimpleStruct(Map<String, SimpleStruct.BuilderImpl> mapOfEnumToSimpleStruct) {
this.mapOfEnumToSimpleStruct = MapOfEnumToSimpleStructCopier.copyFromBuilder(mapOfEnumToSimpleStruct);
}
public final Map<String, ? extends Collection<String>> getMapOfEnumToListOfEnums() {
return mapOfEnumToListOfEnums;
}
@Override
public final Builder mapOfEnumToListOfEnumsWithStrings(Map<String, ? extends Collection<String>> mapOfEnumToListOfEnums) {
this.mapOfEnumToListOfEnums = MapOfEnumToListOfEnumsCopier.copy(mapOfEnumToListOfEnums);
return this;
}
@Override
public final Builder mapOfEnumToListOfEnums(Map<EnumType, ? extends Collection<EnumType>> mapOfEnumToListOfEnums) {
this.mapOfEnumToListOfEnums = MapOfEnumToListOfEnumsCopier.copyEnumToString(mapOfEnumToListOfEnums);
return this;
}
public final void setMapOfEnumToListOfEnums(Map<String, ? extends Collection<String>> mapOfEnumToListOfEnums) {
this.mapOfEnumToListOfEnums = MapOfEnumToListOfEnumsCopier.copy(mapOfEnumToListOfEnums);
}
public final Map<String, Map<String, String>> getMapOfEnumToMapOfStringToEnum() {
return mapOfEnumToMapOfStringToEnum;
}
@Override
public final Builder mapOfEnumToMapOfStringToEnumWithStrings(Map<String, Map<String, String>> mapOfEnumToMapOfStringToEnum) {
this.mapOfEnumToMapOfStringToEnum = MapOfEnumToMapOfStringToEnumCopier.copy(mapOfEnumToMapOfStringToEnum);
return this;
}
@Override
public final Builder mapOfEnumToMapOfStringToEnum(Map<EnumType, Map<String, EnumType>> mapOfEnumToMapOfStringToEnum) {
this.mapOfEnumToMapOfStringToEnum = MapOfEnumToMapOfStringToEnumCopier.copyEnumToString(mapOfEnumToMapOfStringToEnum);
return this;
}
public final void setMapOfEnumToMapOfStringToEnum(Map<String, Map<String, String>> mapOfEnumToMapOfStringToEnum) {
this.mapOfEnumToMapOfStringToEnum = MapOfEnumToMapOfStringToEnumCopier.copy(mapOfEnumToMapOfStringToEnum);
}
public final Instant getTimestampMember() {
return timestampMember;
}
@Override
public final Builder timestampMember(Instant timestampMember) {
this.timestampMember = timestampMember;
return this;
}
public final void setTimestampMember(Instant timestampMember) {
this.timestampMember = timestampMember;
}
public final StructWithTimestamp.Builder getStructWithNestedTimestampMember() {
return structWithNestedTimestampMember != null ? structWithNestedTimestampMember.toBuilder() : null;
}
@Override
public final Builder structWithNestedTimestampMember(StructWithTimestamp structWithNestedTimestampMember) {
this.structWithNestedTimestampMember = structWithNestedTimestampMember;
return this;
}
public final void setStructWithNestedTimestampMember(StructWithTimestamp.BuilderImpl structWithNestedTimestampMember) {
this.structWithNestedTimestampMember = structWithNestedTimestampMember != null ? structWithNestedTimestampMember
.build() : null;
}
public final ByteBuffer getBlobArg() {
return blobArg == null ? null : blobArg.asByteBuffer();
}
@Override
public final Builder blobArg(SdkBytes blobArg) {
this.blobArg = StandardMemberCopier.copy(blobArg);
return this;
}
public final void setBlobArg(ByteBuffer blobArg) {
blobArg(blobArg == null ? null : SdkBytes.fromByteBuffer(blobArg));
}
public final StructWithNestedBlobType.Builder getStructWithNestedBlob() {
return structWithNestedBlob != null ? structWithNestedBlob.toBuilder() : null;
}
@Override
public final Builder structWithNestedBlob(StructWithNestedBlobType structWithNestedBlob) {
this.structWithNestedBlob = structWithNestedBlob;
return this;
}
public final void setStructWithNestedBlob(StructWithNestedBlobType.BuilderImpl structWithNestedBlob) {
this.structWithNestedBlob = structWithNestedBlob != null ? structWithNestedBlob.build() : null;
}
public final Map<String, ByteBuffer> getBlobMap() {
return blobMap == null ? null : blobMap.entrySet().stream()
.collect(Collectors.toMap(e -> e.getKey(), e -> e.getValue().asByteBuffer()));
}
@Override
public final Builder blobMap(Map<String, SdkBytes> blobMap) {
this.blobMap = BlobMapTypeCopier.copy(blobMap);
return this;
}
public final void setBlobMap(Map<String, ByteBuffer> blobMap) {
blobMap(blobMap == null ? null : blobMap.entrySet().stream()
.collect(Collectors.toMap(e -> e.getKey(), e -> SdkBytes.fromByteBuffer(e.getValue()))));
}
public final List<ByteBuffer> getListOfBlobs() {
return listOfBlobs == null ? null : listOfBlobs.stream().map(SdkBytes::asByteBuffer).collect(Collectors.toList());
}
@Override
public final Builder listOfBlobs(Collection<SdkBytes> listOfBlobs) {
this.listOfBlobs = ListOfBlobsTypeCopier.copy(listOfBlobs);
return this;
}
@Override
@SafeVarargs
public final Builder listOfBlobs(SdkBytes... listOfBlobs) {
listOfBlobs(Arrays.asList(listOfBlobs));
return this;
}
public final void setListOfBlobs(Collection<ByteBuffer> listOfBlobs) {
listOfBlobs(listOfBlobs == null ? null : listOfBlobs.stream().map(SdkBytes::fromByteBuffer)
.collect(Collectors.toList()));
}
public final RecursiveStructType.Builder getRecursiveStruct() {
return recursiveStruct != null ? recursiveStruct.toBuilder() : null;
}
@Override
public final Builder recursiveStruct(RecursiveStructType recursiveStruct) {
this.recursiveStruct = recursiveStruct;
return this;
}
public final void setRecursiveStruct(RecursiveStructType.BuilderImpl recursiveStruct) {
this.recursiveStruct = recursiveStruct != null ? recursiveStruct.build() : null;
}
public final BaseType.Builder getPolymorphicTypeWithSubTypes() {
return polymorphicTypeWithSubTypes != null ? polymorphicTypeWithSubTypes.toBuilder() : null;
}
@Override
public final Builder polymorphicTypeWithSubTypes(BaseType polymorphicTypeWithSubTypes) {
this.polymorphicTypeWithSubTypes = polymorphicTypeWithSubTypes;
return this;
}
public final void setPolymorphicTypeWithSubTypes(BaseType.BuilderImpl polymorphicTypeWithSubTypes) {
this.polymorphicTypeWithSubTypes = polymorphicTypeWithSubTypes != null ? polymorphicTypeWithSubTypes.build() : null;
}
public final SubTypeOne.Builder getPolymorphicTypeWithoutSubTypes() {
return polymorphicTypeWithoutSubTypes != null ? polymorphicTypeWithoutSubTypes.toBuilder() : null;
}
@Override
public final Builder polymorphicTypeWithoutSubTypes(SubTypeOne polymorphicTypeWithoutSubTypes) {
this.polymorphicTypeWithoutSubTypes = polymorphicTypeWithoutSubTypes;
return this;
}
public final void setPolymorphicTypeWithoutSubTypes(SubTypeOne.BuilderImpl polymorphicTypeWithoutSubTypes) {
this.polymorphicTypeWithoutSubTypes = polymorphicTypeWithoutSubTypes != null ? polymorphicTypeWithoutSubTypes.build()
: null;
}
public final String getEnumType() {
return enumType;
}
@Override
public final Builder enumType(String enumType) {
this.enumType = enumType;
return this;
}
@Override
public final Builder enumType(EnumType enumType) {
this.enumType(enumType == null ? null : enumType.toString());
return this;
}
public final void setEnumType(String enumType) {
this.enumType = enumType;
}
@Override
public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) {
super.overrideConfiguration(overrideConfiguration);
return this;
}
@Override
public Builder overrideConfiguration(Consumer<AwsRequestOverrideConfiguration.Builder> builderConsumer) {
super.overrideConfiguration(builderConsumer);
return this;
}
@Override
public AllTypesRequest build() {
return new AllTypesRequest(this);
}
@Override
public List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
}
}
| 3,486 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/rules/endpoint-resolve-interceptor.java | package software.amazon.awssdk.services.query.endpoints.internal;
import java.util.List;
import java.util.Optional;
import java.util.concurrent.CompletionException;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.annotations.SdkInternalApi;
import software.amazon.awssdk.awscore.AwsExecutionAttribute;
import software.amazon.awssdk.awscore.endpoints.AwsEndpointAttribute;
import software.amazon.awssdk.awscore.endpoints.authscheme.EndpointAuthScheme;
import software.amazon.awssdk.awscore.endpoints.authscheme.SigV4AuthScheme;
import software.amazon.awssdk.awscore.endpoints.authscheme.SigV4aAuthScheme;
import software.amazon.awssdk.core.SdkRequest;
import software.amazon.awssdk.core.SelectedAuthScheme;
import software.amazon.awssdk.core.exception.SdkClientException;
import software.amazon.awssdk.core.interceptor.Context;
import software.amazon.awssdk.core.interceptor.ExecutionAttributes;
import software.amazon.awssdk.core.interceptor.ExecutionInterceptor;
import software.amazon.awssdk.core.interceptor.SdkExecutionAttribute;
import software.amazon.awssdk.core.interceptor.SdkInternalExecutionAttribute;
import software.amazon.awssdk.endpoints.Endpoint;
import software.amazon.awssdk.http.SdkHttpRequest;
import software.amazon.awssdk.http.auth.aws.signer.AwsV4HttpSigner;
import software.amazon.awssdk.http.auth.aws.signer.AwsV4aHttpSigner;
import software.amazon.awssdk.http.auth.aws.signer.RegionSet;
import software.amazon.awssdk.http.auth.spi.scheme.AuthSchemeOption;
import software.amazon.awssdk.identity.spi.Identity;
import software.amazon.awssdk.services.query.endpoints.QueryClientContextParams;
import software.amazon.awssdk.services.query.endpoints.QueryEndpointParams;
import software.amazon.awssdk.services.query.endpoints.QueryEndpointProvider;
import software.amazon.awssdk.services.query.model.OperationWithContextParamRequest;
import software.amazon.awssdk.utils.AttributeMap;
@Generated("software.amazon.awssdk:codegen")
@SdkInternalApi
public final class QueryResolveEndpointInterceptor implements ExecutionInterceptor {
@Override
public SdkRequest modifyRequest(Context.ModifyRequest context, ExecutionAttributes executionAttributes) {
SdkRequest result = context.request();
if (AwsEndpointProviderUtils.endpointIsDiscovered(executionAttributes)) {
return result;
}
QueryEndpointProvider provider = (QueryEndpointProvider) executionAttributes
.getAttribute(SdkInternalExecutionAttribute.ENDPOINT_PROVIDER);
try {
Endpoint endpoint = provider.resolveEndpoint(ruleParams(result, executionAttributes)).join();
if (!AwsEndpointProviderUtils.disableHostPrefixInjection(executionAttributes)) {
Optional<String> hostPrefix = hostPrefix(executionAttributes.getAttribute(SdkExecutionAttribute.OPERATION_NAME),
result);
if (hostPrefix.isPresent()) {
endpoint = AwsEndpointProviderUtils.addHostPrefix(endpoint, hostPrefix.get());
}
}
List<EndpointAuthScheme> endpointAuthSchemes = endpoint.attribute(AwsEndpointAttribute.AUTH_SCHEMES);
SelectedAuthScheme<?> selectedAuthScheme = executionAttributes
.getAttribute(SdkInternalExecutionAttribute.SELECTED_AUTH_SCHEME);
if (endpointAuthSchemes != null && selectedAuthScheme != null) {
selectedAuthScheme = authSchemeWithEndpointSignerProperties(endpointAuthSchemes, selectedAuthScheme);
executionAttributes.putAttribute(SdkInternalExecutionAttribute.SELECTED_AUTH_SCHEME, selectedAuthScheme);
}
executionAttributes.putAttribute(SdkInternalExecutionAttribute.RESOLVED_ENDPOINT, endpoint);
return result;
} catch (CompletionException e) {
Throwable cause = e.getCause();
if (cause instanceof SdkClientException) {
throw (SdkClientException) cause;
} else {
throw SdkClientException.create("Endpoint resolution failed", cause);
}
}
}
@Override
public SdkHttpRequest modifyHttpRequest(Context.ModifyHttpRequest context, ExecutionAttributes executionAttributes) {
Endpoint resolvedEndpoint = executionAttributes.getAttribute(SdkInternalExecutionAttribute.RESOLVED_ENDPOINT);
if (resolvedEndpoint.headers().isEmpty()) {
return context.httpRequest();
}
SdkHttpRequest.Builder httpRequestBuilder = context.httpRequest().toBuilder();
resolvedEndpoint.headers().forEach((name, values) -> {
values.forEach(v -> httpRequestBuilder.appendHeader(name, v));
});
return httpRequestBuilder.build();
}
public static QueryEndpointParams ruleParams(SdkRequest request, ExecutionAttributes executionAttributes) {
QueryEndpointParams.Builder builder = QueryEndpointParams.builder();
builder.region(AwsEndpointProviderUtils.regionBuiltIn(executionAttributes));
builder.useDualStackEndpoint(AwsEndpointProviderUtils.dualStackEnabledBuiltIn(executionAttributes));
builder.useFipsEndpoint(AwsEndpointProviderUtils.fipsEnabledBuiltIn(executionAttributes));
setClientContextParams(builder, executionAttributes);
setContextParams(builder, executionAttributes.getAttribute(AwsExecutionAttribute.OPERATION_NAME), request);
setStaticContextParams(builder, executionAttributes.getAttribute(AwsExecutionAttribute.OPERATION_NAME));
return builder.build();
}
private static void setContextParams(QueryEndpointParams.Builder params, String operationName, SdkRequest request) {
switch (operationName) {
case "OperationWithContextParam":
setContextParams(params, (OperationWithContextParamRequest) request);
break;
default:
break;
}
}
private static void setContextParams(QueryEndpointParams.Builder params, OperationWithContextParamRequest request) {
params.operationContextParam(request.stringMember());
}
private static void setStaticContextParams(QueryEndpointParams.Builder params, String operationName) {
switch (operationName) {
case "OperationWithStaticContextParams":
operationWithStaticContextParamsStaticContextParams(params);
break;
default:
break;
}
}
private static void operationWithStaticContextParamsStaticContextParams(QueryEndpointParams.Builder params) {
params.staticStringParam("hello");
}
private <T extends Identity> SelectedAuthScheme<T> authSchemeWithEndpointSignerProperties(
List<EndpointAuthScheme> endpointAuthSchemes, SelectedAuthScheme<T> selectedAuthScheme) {
for (EndpointAuthScheme endpointAuthScheme : endpointAuthSchemes) {
if (!endpointAuthScheme.schemeId().equals(selectedAuthScheme.authSchemeOption().schemeId())) {
continue;
}
AuthSchemeOption.Builder option = selectedAuthScheme.authSchemeOption().toBuilder();
if (endpointAuthScheme instanceof SigV4AuthScheme) {
SigV4AuthScheme v4AuthScheme = (SigV4AuthScheme) endpointAuthScheme;
if (v4AuthScheme.isDisableDoubleEncodingSet()) {
option.putSignerProperty(AwsV4HttpSigner.DOUBLE_URL_ENCODE, !v4AuthScheme.disableDoubleEncoding());
}
if (v4AuthScheme.signingRegion() != null) {
option.putSignerProperty(AwsV4HttpSigner.REGION_NAME, v4AuthScheme.signingRegion());
}
if (v4AuthScheme.signingName() != null) {
option.putSignerProperty(AwsV4HttpSigner.SERVICE_SIGNING_NAME, v4AuthScheme.signingName());
}
return new SelectedAuthScheme<>(selectedAuthScheme.identity(), selectedAuthScheme.signer(), option.build());
}
if (endpointAuthScheme instanceof SigV4aAuthScheme) {
SigV4aAuthScheme v4aAuthScheme = (SigV4aAuthScheme) endpointAuthScheme;
if (v4aAuthScheme.isDisableDoubleEncodingSet()) {
option.putSignerProperty(AwsV4aHttpSigner.DOUBLE_URL_ENCODE, !v4aAuthScheme.disableDoubleEncoding());
}
if (v4aAuthScheme.signingRegionSet() != null) {
RegionSet regionSet = RegionSet.create(v4aAuthScheme.signingRegionSet());
option.putSignerProperty(AwsV4aHttpSigner.REGION_SET, regionSet);
}
if (v4aAuthScheme.signingName() != null) {
option.putSignerProperty(AwsV4aHttpSigner.SERVICE_SIGNING_NAME, v4aAuthScheme.signingName());
}
return new SelectedAuthScheme<>(selectedAuthScheme.identity(), selectedAuthScheme.signer(), option.build());
}
throw new IllegalArgumentException("Endpoint auth scheme '" + endpointAuthScheme.name()
+ "' cannot be mapped to the SDK auth scheme. Was it declared in the service's model?");
}
return selectedAuthScheme;
}
private static void setClientContextParams(QueryEndpointParams.Builder params, ExecutionAttributes executionAttributes) {
AttributeMap clientContextParams = executionAttributes.getAttribute(SdkInternalExecutionAttribute.CLIENT_CONTEXT_PARAMS);
Optional.ofNullable(clientContextParams.get(QueryClientContextParams.BOOLEAN_CONTEXT_PARAM)).ifPresent(
params::booleanContextParam);
Optional.ofNullable(clientContextParams.get(QueryClientContextParams.STRING_CONTEXT_PARAM)).ifPresent(
params::stringContextParam);
}
private static Optional<String> hostPrefix(String operationName, SdkRequest request) {
switch (operationName) {
case "APostOperation": {
return Optional.of("foo-");
}
default:
return Optional.empty();
}
}
}
| 3,487 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/rules/endpoint-resolve-interceptor-preSra.java | package software.amazon.awssdk.services.query.endpoints.internal;
import java.util.List;
import java.util.Optional;
import java.util.concurrent.CompletionException;
import java.util.function.Supplier;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.annotations.SdkInternalApi;
import software.amazon.awssdk.auth.signer.Aws4Signer;
import software.amazon.awssdk.auth.signer.SignerLoader;
import software.amazon.awssdk.awscore.AwsExecutionAttribute;
import software.amazon.awssdk.awscore.endpoints.AwsEndpointAttribute;
import software.amazon.awssdk.awscore.endpoints.authscheme.EndpointAuthScheme;
import software.amazon.awssdk.awscore.endpoints.authscheme.SigV4AuthScheme;
import software.amazon.awssdk.awscore.endpoints.authscheme.SigV4aAuthScheme;
import software.amazon.awssdk.awscore.util.SignerOverrideUtils;
import software.amazon.awssdk.core.SdkRequest;
import software.amazon.awssdk.core.SelectedAuthScheme;
import software.amazon.awssdk.core.exception.SdkClientException;
import software.amazon.awssdk.core.interceptor.Context;
import software.amazon.awssdk.core.interceptor.ExecutionAttributes;
import software.amazon.awssdk.core.interceptor.ExecutionInterceptor;
import software.amazon.awssdk.core.interceptor.SdkExecutionAttribute;
import software.amazon.awssdk.core.interceptor.SdkInternalExecutionAttribute;
import software.amazon.awssdk.core.signer.Signer;
import software.amazon.awssdk.endpoints.Endpoint;
import software.amazon.awssdk.http.SdkHttpRequest;
import software.amazon.awssdk.http.auth.aws.signer.AwsV4HttpSigner;
import software.amazon.awssdk.http.auth.aws.signer.AwsV4aHttpSigner;
import software.amazon.awssdk.http.auth.aws.signer.RegionSet;
import software.amazon.awssdk.http.auth.spi.scheme.AuthSchemeOption;
import software.amazon.awssdk.identity.spi.Identity;
import software.amazon.awssdk.services.query.endpoints.QueryClientContextParams;
import software.amazon.awssdk.services.query.endpoints.QueryEndpointParams;
import software.amazon.awssdk.services.query.endpoints.QueryEndpointProvider;
import software.amazon.awssdk.services.query.model.OperationWithContextParamRequest;
import software.amazon.awssdk.utils.AttributeMap;
@Generated("software.amazon.awssdk:codegen")
@SdkInternalApi
public final class QueryResolveEndpointInterceptor implements ExecutionInterceptor {
@Override
public SdkRequest modifyRequest(Context.ModifyRequest context, ExecutionAttributes executionAttributes) {
SdkRequest result = context.request();
if (AwsEndpointProviderUtils.endpointIsDiscovered(executionAttributes)) {
return result;
}
QueryEndpointProvider provider = (QueryEndpointProvider) executionAttributes
.getAttribute(SdkInternalExecutionAttribute.ENDPOINT_PROVIDER);
try {
Endpoint endpoint = provider.resolveEndpoint(ruleParams(result, executionAttributes)).join();
if (!AwsEndpointProviderUtils.disableHostPrefixInjection(executionAttributes)) {
Optional<String> hostPrefix = hostPrefix(executionAttributes.getAttribute(SdkExecutionAttribute.OPERATION_NAME),
result);
if (hostPrefix.isPresent()) {
endpoint = AwsEndpointProviderUtils.addHostPrefix(endpoint, hostPrefix.get());
}
}
List<EndpointAuthScheme> endpointAuthSchemes = endpoint.attribute(AwsEndpointAttribute.AUTH_SCHEMES);
SelectedAuthScheme<?> selectedAuthScheme = executionAttributes
.getAttribute(SdkInternalExecutionAttribute.SELECTED_AUTH_SCHEME);
if (endpointAuthSchemes != null && selectedAuthScheme != null) {
selectedAuthScheme = authSchemeWithEndpointSignerProperties(endpointAuthSchemes, selectedAuthScheme);
executionAttributes.putAttribute(SdkInternalExecutionAttribute.SELECTED_AUTH_SCHEME, selectedAuthScheme);
}
if (endpointAuthSchemes != null) {
EndpointAuthScheme chosenAuthScheme = AuthSchemeUtils.chooseAuthScheme(endpointAuthSchemes);
Supplier<Signer> signerProvider = signerProvider(chosenAuthScheme);
result = SignerOverrideUtils.overrideSignerIfNotOverridden(result, executionAttributes, signerProvider);
}
executionAttributes.putAttribute(SdkInternalExecutionAttribute.RESOLVED_ENDPOINT, endpoint);
return result;
} catch (CompletionException e) {
Throwable cause = e.getCause();
if (cause instanceof SdkClientException) {
throw (SdkClientException) cause;
} else {
throw SdkClientException.create("Endpoint resolution failed", cause);
}
}
}
@Override
public SdkHttpRequest modifyHttpRequest(Context.ModifyHttpRequest context, ExecutionAttributes executionAttributes) {
Endpoint resolvedEndpoint = executionAttributes.getAttribute(SdkInternalExecutionAttribute.RESOLVED_ENDPOINT);
if (resolvedEndpoint.headers().isEmpty()) {
return context.httpRequest();
}
SdkHttpRequest.Builder httpRequestBuilder = context.httpRequest().toBuilder();
resolvedEndpoint.headers().forEach((name, values) -> {
values.forEach(v -> httpRequestBuilder.appendHeader(name, v));
});
return httpRequestBuilder.build();
}
public static QueryEndpointParams ruleParams(SdkRequest request, ExecutionAttributes executionAttributes) {
QueryEndpointParams.Builder builder = QueryEndpointParams.builder();
builder.region(AwsEndpointProviderUtils.regionBuiltIn(executionAttributes));
builder.useDualStackEndpoint(AwsEndpointProviderUtils.dualStackEnabledBuiltIn(executionAttributes));
builder.useFipsEndpoint(AwsEndpointProviderUtils.fipsEnabledBuiltIn(executionAttributes));
setClientContextParams(builder, executionAttributes);
setContextParams(builder, executionAttributes.getAttribute(AwsExecutionAttribute.OPERATION_NAME), request);
setStaticContextParams(builder, executionAttributes.getAttribute(AwsExecutionAttribute.OPERATION_NAME));
return builder.build();
}
private static void setContextParams(QueryEndpointParams.Builder params, String operationName, SdkRequest request) {
switch (operationName) {
case "OperationWithContextParam":
setContextParams(params, (OperationWithContextParamRequest) request);
break;
default:
break;
}
}
private static void setContextParams(QueryEndpointParams.Builder params, OperationWithContextParamRequest request) {
params.operationContextParam(request.stringMember());
}
private static void setStaticContextParams(QueryEndpointParams.Builder params, String operationName) {
switch (operationName) {
case "OperationWithStaticContextParams":
operationWithStaticContextParamsStaticContextParams(params);
break;
default:
break;
}
}
private static void operationWithStaticContextParamsStaticContextParams(QueryEndpointParams.Builder params) {
params.staticStringParam("hello");
}
private <T extends Identity> SelectedAuthScheme<T> authSchemeWithEndpointSignerProperties(
List<EndpointAuthScheme> endpointAuthSchemes, SelectedAuthScheme<T> selectedAuthScheme) {
for (EndpointAuthScheme endpointAuthScheme : endpointAuthSchemes) {
AuthSchemeOption.Builder option = selectedAuthScheme.authSchemeOption().toBuilder();
if (endpointAuthScheme instanceof SigV4AuthScheme) {
SigV4AuthScheme v4AuthScheme = (SigV4AuthScheme) endpointAuthScheme;
if (v4AuthScheme.isDisableDoubleEncodingSet()) {
option.putSignerProperty(AwsV4HttpSigner.DOUBLE_URL_ENCODE, !v4AuthScheme.disableDoubleEncoding());
}
if (v4AuthScheme.signingRegion() != null) {
option.putSignerProperty(AwsV4HttpSigner.REGION_NAME, v4AuthScheme.signingRegion());
}
if (v4AuthScheme.signingName() != null) {
option.putSignerProperty(AwsV4HttpSigner.SERVICE_SIGNING_NAME, v4AuthScheme.signingName());
}
return new SelectedAuthScheme<>(selectedAuthScheme.identity(), selectedAuthScheme.signer(), option.build());
}
if (endpointAuthScheme instanceof SigV4aAuthScheme) {
SigV4aAuthScheme v4aAuthScheme = (SigV4aAuthScheme) endpointAuthScheme;
if (v4aAuthScheme.isDisableDoubleEncodingSet()) {
option.putSignerProperty(AwsV4aHttpSigner.DOUBLE_URL_ENCODE, !v4aAuthScheme.disableDoubleEncoding());
}
if (v4aAuthScheme.signingRegionSet() != null) {
RegionSet regionSet = RegionSet.create(v4aAuthScheme.signingRegionSet());
option.putSignerProperty(AwsV4aHttpSigner.REGION_SET, regionSet);
}
if (v4aAuthScheme.signingName() != null) {
option.putSignerProperty(AwsV4aHttpSigner.SERVICE_SIGNING_NAME, v4aAuthScheme.signingName());
}
return new SelectedAuthScheme<>(selectedAuthScheme.identity(), selectedAuthScheme.signer(), option.build());
}
throw new IllegalArgumentException("Endpoint auth scheme '" + endpointAuthScheme.name()
+ "' cannot be mapped to the SDK auth scheme. Was it declared in the service's model?");
}
return selectedAuthScheme;
}
private static void setClientContextParams(QueryEndpointParams.Builder params, ExecutionAttributes executionAttributes) {
AttributeMap clientContextParams = executionAttributes.getAttribute(SdkInternalExecutionAttribute.CLIENT_CONTEXT_PARAMS);
Optional.ofNullable(clientContextParams.get(QueryClientContextParams.BOOLEAN_CONTEXT_PARAM)).ifPresent(
params::booleanContextParam);
Optional.ofNullable(clientContextParams.get(QueryClientContextParams.STRING_CONTEXT_PARAM)).ifPresent(
params::stringContextParam);
}
private static Optional<String> hostPrefix(String operationName, SdkRequest request) {
switch (operationName) {
case "APostOperation": {
return Optional.of("foo-");
}
default:
return Optional.empty();
}
}
private Supplier<Signer> signerProvider(EndpointAuthScheme authScheme) {
switch (authScheme.name()) {
case "sigv4":
return Aws4Signer::create;
case "sigv4a":
return SignerLoader::getSigV4aSigner;
default:
break;
}
throw SdkClientException.create("Don't know how to create signer for auth scheme: " + authScheme.name());
}
}
| 3,488 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/rules/endpoint-parameters.java | package software.amazon.awssdk.services.query.endpoints;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.annotations.SdkPublicApi;
import software.amazon.awssdk.regions.Region;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
* The parameters object used to resolve an endpoint for the Query service.
*/
@Generated("software.amazon.awssdk:codegen")
@SdkPublicApi
public final class QueryEndpointParams implements ToCopyableBuilder<QueryEndpointParams.Builder, QueryEndpointParams> {
private final Region region;
private final Boolean useDualStackEndpoint;
private final Boolean useFIPSEndpoint;
private final String endpointId;
private final Boolean defaultTrueParam;
private final String defaultStringParam;
private final String deprecatedParam;
private final Boolean booleanContextParam;
private final String stringContextParam;
private final String operationContextParam;
private QueryEndpointParams(BuilderImpl builder) {
this.region = builder.region;
this.useDualStackEndpoint = builder.useDualStackEndpoint;
this.useFIPSEndpoint = builder.useFIPSEndpoint;
this.endpointId = builder.endpointId;
this.defaultTrueParam = builder.defaultTrueParam;
this.defaultStringParam = builder.defaultStringParam;
this.deprecatedParam = builder.deprecatedParam;
this.booleanContextParam = builder.booleanContextParam;
this.stringContextParam = builder.stringContextParam;
this.operationContextParam = builder.operationContextParam;
}
public static Builder builder() {
return new BuilderImpl();
}
public Region region() {
return region;
}
public Boolean useDualStackEndpoint() {
return useDualStackEndpoint;
}
public Boolean useFipsEndpoint() {
return useFIPSEndpoint;
}
public String endpointId() {
return endpointId;
}
public Boolean defaultTrueParam() {
return defaultTrueParam;
}
public String defaultStringParam() {
return defaultStringParam;
}
@Deprecated
public String deprecatedParam() {
return deprecatedParam;
}
public Boolean booleanContextParam() {
return booleanContextParam;
}
public String stringContextParam() {
return stringContextParam;
}
public String operationContextParam() {
return operationContextParam;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public interface Builder extends CopyableBuilder<Builder, QueryEndpointParams> {
Builder region(Region region);
Builder useDualStackEndpoint(Boolean useDualStackEndpoint);
Builder useFipsEndpoint(Boolean useFIPSEndpoint);
Builder endpointId(String endpointId);
Builder defaultTrueParam(Boolean defaultTrueParam);
Builder defaultStringParam(String defaultStringParam);
@Deprecated
Builder deprecatedParam(String deprecatedParam);
Builder booleanContextParam(Boolean booleanContextParam);
Builder stringContextParam(String stringContextParam);
Builder operationContextParam(String operationContextParam);
QueryEndpointParams build();
}
private static class BuilderImpl implements Builder {
private Region region;
private Boolean useDualStackEndpoint;
private Boolean useFIPSEndpoint;
private String endpointId;
private Boolean defaultTrueParam = true;
private String defaultStringParam = "hello endpoints";
private String deprecatedParam;
private Boolean booleanContextParam;
private String stringContextParam;
private String operationContextParam;
private BuilderImpl() {
}
private BuilderImpl(QueryEndpointParams builder) {
this.region = builder.region;
this.useDualStackEndpoint = builder.useDualStackEndpoint;
this.useFIPSEndpoint = builder.useFIPSEndpoint;
this.endpointId = builder.endpointId;
this.defaultTrueParam = builder.defaultTrueParam;
this.defaultStringParam = builder.defaultStringParam;
this.deprecatedParam = builder.deprecatedParam;
this.booleanContextParam = builder.booleanContextParam;
this.stringContextParam = builder.stringContextParam;
this.operationContextParam = builder.operationContextParam;
}
@Override
public Builder region(Region region) {
this.region = region;
return this;
}
@Override
public Builder useDualStackEndpoint(Boolean useDualStackEndpoint) {
this.useDualStackEndpoint = useDualStackEndpoint;
return this;
}
@Override
public Builder useFipsEndpoint(Boolean useFIPSEndpoint) {
this.useFIPSEndpoint = useFIPSEndpoint;
return this;
}
@Override
public Builder endpointId(String endpointId) {
this.endpointId = endpointId;
return this;
}
@Override
public Builder defaultTrueParam(Boolean defaultTrueParam) {
this.defaultTrueParam = defaultTrueParam;
if (this.defaultTrueParam == null) {
this.defaultTrueParam = true;
}
return this;
}
@Override
public Builder defaultStringParam(String defaultStringParam) {
this.defaultStringParam = defaultStringParam;
if (this.defaultStringParam == null) {
this.defaultStringParam = "hello endpoints";
}
return this;
}
@Deprecated
@Override
public Builder deprecatedParam(String deprecatedParam) {
this.deprecatedParam = deprecatedParam;
return this;
}
@Override
public Builder booleanContextParam(Boolean booleanContextParam) {
this.booleanContextParam = booleanContextParam;
return this;
}
@Override
public Builder stringContextParam(String stringContextParam) {
this.stringContextParam = stringContextParam;
return this;
}
@Override
public Builder operationContextParam(String operationContextParam) {
this.operationContextParam = operationContextParam;
return this;
}
@Override
public QueryEndpointParams build() {
return new QueryEndpointParams(this);
}
}
}
| 3,489 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/rules/endpoint-provider-class.java | package software.amazon.awssdk.services.query.endpoints.internal;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.CompletableFuture;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.annotations.SdkInternalApi;
import software.amazon.awssdk.endpoints.Endpoint;
import software.amazon.awssdk.services.query.endpoints.QueryEndpointParams;
import software.amazon.awssdk.services.query.endpoints.QueryEndpointProvider;
import software.amazon.awssdk.utils.CompletableFutureUtils;
import software.amazon.awssdk.utils.MapUtils;
import software.amazon.awssdk.utils.Validate;
@Generated("software.amazon.awssdk:codegen")
@SdkInternalApi
public final class DefaultQueryEndpointProvider implements QueryEndpointProvider {
private static final EndpointRuleset ENDPOINT_RULE_SET = ruleSet();
@Override
public CompletableFuture<Endpoint> resolveEndpoint(QueryEndpointParams endpointParams) {
Validate.notNull(endpointParams.region(), "Parameter 'region' must not be null");
Value res = new DefaultRuleEngine().evaluate(ENDPOINT_RULE_SET, toIdentifierValueMap(endpointParams));
try {
return CompletableFuture.completedFuture(AwsEndpointProviderUtils.valueAsEndpointOrThrow(res));
} catch (Exception error) {
return CompletableFutureUtils.failedFuture(error);
}
}
private static Map<Identifier, Value> toIdentifierValueMap(QueryEndpointParams params) {
Map<Identifier, Value> paramsMap = new HashMap<>();
if (params.region() != null) {
paramsMap.put(Identifier.of("region"), Value.fromStr(params.region().id()));
}
if (params.useDualStackEndpoint() != null) {
paramsMap.put(Identifier.of("useDualStackEndpoint"), Value.fromBool(params.useDualStackEndpoint()));
}
if (params.useFipsEndpoint() != null) {
paramsMap.put(Identifier.of("useFIPSEndpoint"), Value.fromBool(params.useFipsEndpoint()));
}
if (params.endpointId() != null) {
paramsMap.put(Identifier.of("endpointId"), Value.fromStr(params.endpointId()));
}
if (params.defaultTrueParam() != null) {
paramsMap.put(Identifier.of("defaultTrueParam"), Value.fromBool(params.defaultTrueParam()));
}
if (params.defaultStringParam() != null) {
paramsMap.put(Identifier.of("defaultStringParam"), Value.fromStr(params.defaultStringParam()));
}
if (params.deprecatedParam() != null) {
paramsMap.put(Identifier.of("deprecatedParam"), Value.fromStr(params.deprecatedParam()));
}
if (params.booleanContextParam() != null) {
paramsMap.put(Identifier.of("booleanContextParam"), Value.fromBool(params.booleanContextParam()));
}
if (params.stringContextParam() != null) {
paramsMap.put(Identifier.of("stringContextParam"), Value.fromStr(params.stringContextParam()));
}
if (params.operationContextParam() != null) {
paramsMap.put(Identifier.of("operationContextParam"), Value.fromStr(params.operationContextParam()));
}
return paramsMap;
}
private static Rule endpointRule_2() {
return Rule
.builder()
.addCondition(
Condition
.builder()
.fn(FnNode.builder().fn("isSet").argv(Arrays.asList(Expr.ref(Identifier.of("useFIPSEndpoint"))))
.build().validate()).build())
.addCondition(
Condition
.builder()
.fn(FnNode.builder().fn("booleanEquals")
.argv(Arrays.asList(Expr.ref(Identifier.of("useFIPSEndpoint")), Expr.of(true))).build()
.validate()).build()).error("FIPS endpoints not supported with multi-region endpoints");
}
private static Rule endpointRule_3() {
return Rule
.builder()
.addCondition(
Condition
.builder()
.fn(FnNode
.builder()
.fn("not")
.argv(Arrays.asList(FnNode.builder().fn("isSet")
.argv(Arrays.asList(Expr.ref(Identifier.of("useFIPSEndpoint")))).build()
.validate())).build().validate()).build())
.addCondition(
Condition
.builder()
.fn(FnNode.builder().fn("isSet")
.argv(Arrays.asList(Expr.ref(Identifier.of("useDualStackEndpoint")))).build().validate())
.build())
.addCondition(
Condition
.builder()
.fn(FnNode.builder().fn("booleanEquals")
.argv(Arrays.asList(Expr.ref(Identifier.of("useDualStackEndpoint")), Expr.of(true)))
.build().validate()).build())
.endpoint(
EndpointResult
.builder()
.url(Expr.of("https://{endpointId}.query.{partitionResult#dualStackDnsSuffix}"))
.addProperty(
Identifier.of("authSchemes"),
Literal.fromTuple(Arrays.asList(Literal.fromRecord(MapUtils.of(Identifier.of("name"),
Literal.fromStr("sigv4a"), Identifier.of("signingName"),
Literal.fromStr("query"), Identifier.of("signingRegionSet"),
Literal.fromTuple(Arrays.asList(Literal.fromStr("*")))))))).build());
}
private static Rule endpointRule_4() {
return Rule.builder()
.endpoint(
EndpointResult
.builder()
.url(Expr.of("https://{endpointId}.query.{partitionResult#dnsSuffix}"))
.addProperty(
Identifier.of("authSchemes"),
Literal.fromTuple(Arrays.asList(Literal.fromRecord(MapUtils.of(Identifier.of("name"),
Literal.fromStr("sigv4a"), Identifier.of("signingName"),
Literal.fromStr("query"), Identifier.of("signingRegionSet"),
Literal.fromTuple(Arrays.asList(Literal.fromStr("*")))))))).build());
}
private static Rule endpointRule_1() {
return Rule
.builder()
.addCondition(
Condition
.builder()
.fn(FnNode.builder().fn("isSet").argv(Arrays.asList(Expr.ref(Identifier.of("endpointId"))))
.build().validate()).build())
.treeRule(Arrays.asList(endpointRule_2(), endpointRule_3(), endpointRule_4()));
}
private static Rule endpointRule_6() {
return Rule
.builder()
.addCondition(
Condition
.builder()
.fn(FnNode.builder().fn("isSet").argv(Arrays.asList(Expr.ref(Identifier.of("useFIPSEndpoint"))))
.build().validate()).build())
.addCondition(
Condition
.builder()
.fn(FnNode.builder().fn("booleanEquals")
.argv(Arrays.asList(Expr.ref(Identifier.of("useFIPSEndpoint")), Expr.of(true))).build()
.validate()).build())
.addCondition(
Condition
.builder()
.fn(FnNode
.builder()
.fn("not")
.argv(Arrays.asList(FnNode.builder().fn("isSet")
.argv(Arrays.asList(Expr.ref(Identifier.of("useDualStackEndpoint")))).build()
.validate())).build().validate()).build())
.endpoint(
EndpointResult
.builder()
.url(Expr.of("https://query-fips.{region}.{partitionResult#dnsSuffix}"))
.addProperty(
Identifier.of("authSchemes"),
Literal.fromTuple(Arrays.asList(Literal.fromRecord(MapUtils.of(Identifier.of("name"),
Literal.fromStr("sigsigv4a"), Identifier.of("signingName"),
Literal.fromStr("query"), Identifier.of("signingRegionSet"),
Literal.fromTuple(Arrays.asList(Literal.fromStr("*")))))))).build());
}
private static Rule endpointRule_7() {
return Rule
.builder()
.addCondition(
Condition
.builder()
.fn(FnNode.builder().fn("isSet")
.argv(Arrays.asList(Expr.ref(Identifier.of("useDualStackEndpoint")))).build().validate())
.build())
.addCondition(
Condition
.builder()
.fn(FnNode.builder().fn("booleanEquals")
.argv(Arrays.asList(Expr.ref(Identifier.of("useDualStackEndpoint")), Expr.of(true)))
.build().validate()).build())
.addCondition(
Condition
.builder()
.fn(FnNode
.builder()
.fn("not")
.argv(Arrays.asList(FnNode.builder().fn("isSet")
.argv(Arrays.asList(Expr.ref(Identifier.of("useFIPSEndpoint")))).build()
.validate())).build().validate()).build())
.endpoint(
EndpointResult
.builder()
.url(Expr.of("https://query.{region}.{partitionResult#dualStackDnsSuffix}"))
.addProperty(
Identifier.of("authSchemes"),
Literal.fromTuple(Arrays.asList(Literal.fromRecord(MapUtils.of(Identifier.of("name"),
Literal.fromStr("sigv4a"), Identifier.of("signingName"),
Literal.fromStr("query"), Identifier.of("signingRegionSet"),
Literal.fromTuple(Arrays.asList(Literal.fromStr("*"))))), Literal
.fromRecord(MapUtils.of(Identifier.of("name"), Literal.fromStr("sigv4"),
Identifier.of("signingName"), Literal.fromStr("query"),
Identifier.of("signingRegion"), Literal.fromStr("{region}")))))).build());
}
private static Rule endpointRule_8() {
return Rule
.builder()
.addCondition(
Condition
.builder()
.fn(FnNode.builder().fn("isSet")
.argv(Arrays.asList(Expr.ref(Identifier.of("useDualStackEndpoint")))).build().validate())
.build())
.addCondition(
Condition
.builder()
.fn(FnNode.builder().fn("isSet").argv(Arrays.asList(Expr.ref(Identifier.of("useFIPSEndpoint"))))
.build().validate()).build())
.addCondition(
Condition
.builder()
.fn(FnNode.builder().fn("booleanEquals")
.argv(Arrays.asList(Expr.ref(Identifier.of("useDualStackEndpoint")), Expr.of(true)))
.build().validate()).build())
.addCondition(
Condition
.builder()
.fn(FnNode.builder().fn("booleanEquals")
.argv(Arrays.asList(Expr.ref(Identifier.of("useFIPSEndpoint")), Expr.of(true))).build()
.validate()).build())
.endpoint(
EndpointResult
.builder()
.url(Expr.of("https://query-fips.{region}.{partitionResult#dualStackDnsSuffix}"))
.addProperty(
Identifier.of("authSchemes"),
Literal.fromTuple(Arrays.asList(Literal.fromRecord(MapUtils.of(Identifier.of("name"),
Literal.fromStr("sigv4a"), Identifier.of("signingName"),
Literal.fromStr("query"), Identifier.of("signingRegionSet"),
Literal.fromTuple(Arrays.asList(Literal.fromStr("*")))))))).build());
}
private static Rule endpointRule_9() {
return Rule.builder().endpoint(
EndpointResult.builder().url(Expr.of("https://query.{region}.{partitionResult#dnsSuffix}")).build());
}
private static Rule endpointRule_5() {
return Rule
.builder()
.addCondition(
Condition
.builder()
.fn(FnNode.builder().fn("isValidHostLabel")
.argv(Arrays.asList(Expr.ref(Identifier.of("region")), Expr.of(false))).build()
.validate()).build())
.treeRule(Arrays.asList(endpointRule_6(), endpointRule_7(), endpointRule_8(), endpointRule_9()));
}
private static Rule endpointRule_10() {
return Rule.builder().error("{region} is not a valid HTTP host-label");
}
private static Rule endpointRule_0() {
return Rule
.builder()
.addCondition(
Condition
.builder()
.fn(FnNode.builder().fn("partition").argv(Arrays.asList(Expr.ref(Identifier.of("region"))))
.build().validate()).result("partitionResult").build())
.treeRule(Arrays.asList(endpointRule_1(), endpointRule_5(), endpointRule_10()));
}
private static EndpointRuleset ruleSet() {
return EndpointRuleset
.builder()
.version("1.2")
.serviceId("query")
.parameters(
Parameters
.builder()
.addParameter(
Parameter.builder().name("region").type(ParameterType.fromValue("string")).required(true)
.builtIn("AWS::Region").documentation("The region to send requests to").build())
.addParameter(
Parameter.builder().name("useDualStackEndpoint").type(ParameterType.fromValue("boolean"))
.required(false).builtIn("AWS::UseDualStack").build())
.addParameter(
Parameter.builder().name("useFIPSEndpoint").type(ParameterType.fromValue("boolean"))
.required(false).builtIn("AWS::UseFIPS").build())
.addParameter(
Parameter.builder().name("endpointId").type(ParameterType.fromValue("string"))
.required(false).build())
.addParameter(
Parameter.builder().name("defaultTrueParam").type(ParameterType.fromValue("boolean"))
.required(false).documentation("A param that defauls to true")
.defaultValue(Value.fromBool(true)).build())
.addParameter(
Parameter.builder().name("defaultStringParam").type(ParameterType.fromValue("string"))
.required(false).defaultValue(Value.fromStr("hello endpoints")).build())
.addParameter(
Parameter.builder().name("deprecatedParam").type(ParameterType.fromValue("string"))
.required(false).deprecated(new Parameter.Deprecated("Don't use!", "2021-01-01"))
.build())
.addParameter(
Parameter.builder().name("booleanContextParam").type(ParameterType.fromValue("boolean"))
.required(false).build())
.addParameter(
Parameter.builder().name("stringContextParam").type(ParameterType.fromValue("string"))
.required(false).build())
.addParameter(
Parameter.builder().name("operationContextParam").type(ParameterType.fromValue("string"))
.required(false).build()).build()).addRule(endpointRule_0()).build();
}
@Override
public boolean equals(Object rhs) {
return rhs != null && getClass().equals(rhs.getClass());
}
@Override
public int hashCode() {
return getClass().hashCode();
}
}
| 3,490 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/rules/request-set-endpoint-interceptor.java | package software.amazon.awssdk.services.query.endpoints.internal;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.annotations.SdkInternalApi;
import software.amazon.awssdk.core.interceptor.Context;
import software.amazon.awssdk.core.interceptor.ExecutionAttributes;
import software.amazon.awssdk.core.interceptor.ExecutionInterceptor;
import software.amazon.awssdk.core.interceptor.SdkExecutionAttribute;
import software.amazon.awssdk.core.interceptor.SdkInternalExecutionAttribute;
import software.amazon.awssdk.endpoints.Endpoint;
import software.amazon.awssdk.http.SdkHttpRequest;
@Generated("software.amazon.awssdk:codegen")
@SdkInternalApi
public final class QueryRequestSetEndpointInterceptor implements ExecutionInterceptor {
@Override
public SdkHttpRequest modifyHttpRequest(Context.ModifyHttpRequest context, ExecutionAttributes executionAttributes) {
if (AwsEndpointProviderUtils.endpointIsDiscovered(executionAttributes)) {
return context.httpRequest();
}
Endpoint endpoint = (Endpoint) executionAttributes.getAttribute(SdkInternalExecutionAttribute.RESOLVED_ENDPOINT);
return AwsEndpointProviderUtils.setUri(context.httpRequest(),
executionAttributes.getAttribute(SdkExecutionAttribute.CLIENT_ENDPOINT), endpoint.url());
}
}
| 3,491 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/rules/endpoint-provider-interface.java | package software.amazon.awssdk.services.query.endpoints;
import java.util.concurrent.CompletableFuture;
import java.util.function.Consumer;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.annotations.SdkPublicApi;
import software.amazon.awssdk.endpoints.Endpoint;
import software.amazon.awssdk.endpoints.EndpointProvider;
import software.amazon.awssdk.services.query.endpoints.internal.DefaultQueryEndpointProvider;
/**
* An endpoint provider for Query. The endpoint provider takes a set of parameters using {@link QueryEndpointParams},
* and resolves an {@link Endpoint} base on the given parameters.
*/
@Generated("software.amazon.awssdk:codegen")
@SdkPublicApi
public interface QueryEndpointProvider extends EndpointProvider {
/**
* Compute the endpoint based on the given set of parameters.
*/
CompletableFuture<Endpoint> resolveEndpoint(QueryEndpointParams endpointParams);
/**
* Compute the endpoint based on the given set of parameters.
*/
default CompletableFuture<Endpoint> resolveEndpoint(Consumer<QueryEndpointParams.Builder> endpointParamsConsumer) {
QueryEndpointParams.Builder paramsBuilder = QueryEndpointParams.builder();
endpointParamsConsumer.accept(paramsBuilder);
return resolveEndpoint(paramsBuilder.build());
}
static QueryEndpointProvider defaultProvider() {
return new DefaultQueryEndpointProvider();
}
}
| 3,492 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/rules/client-context-params.java | package software.amazon.awssdk.services.query.endpoints;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.annotations.SdkInternalApi;
import software.amazon.awssdk.utils.AttributeMap;
@Generated("software.amazon.awssdk:codegen")
@SdkInternalApi
public final class QueryClientContextParams<T> extends AttributeMap.Key<T> {
/**
* A boolean client context parameter
*/
public static final QueryClientContextParams<Boolean> BOOLEAN_CONTEXT_PARAM = new QueryClientContextParams<>(Boolean.class);
/**
* a string client context parameter
*/
public static final QueryClientContextParams<String> STRING_CONTEXT_PARAM = new QueryClientContextParams<>(String.class);
private QueryClientContextParams(Class<T> valueClass) {
super(valueClass);
}
}
| 3,493 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/rules/endpoint-rules-test-class.java | package software.amazon.awssdk.services.query.endpoints;
import java.net.URI;
import java.util.Arrays;
import java.util.List;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.MethodSource;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.rules.testing.AsyncTestCase;
import software.amazon.awssdk.core.rules.testing.BaseRuleSetClientTest;
import software.amazon.awssdk.core.rules.testing.SyncTestCase;
import software.amazon.awssdk.core.rules.testing.model.Expect;
import software.amazon.awssdk.endpoints.Endpoint;
import software.amazon.awssdk.regions.Region;
import software.amazon.awssdk.services.query.QueryAsyncClient;
import software.amazon.awssdk.services.query.QueryAsyncClientBuilder;
import software.amazon.awssdk.services.query.QueryClient;
import software.amazon.awssdk.services.query.QueryClientBuilder;
import software.amazon.awssdk.services.query.model.ChecksumStructure;
import software.amazon.awssdk.services.query.model.OperationWithContextParamRequest;
@Generated("software.amazon.awssdk:codegen")
public class QueryClientEndpointTests extends BaseRuleSetClientTest {
@BeforeEach
public void methodSetup() {
super.methodSetup();
}
@AfterAll
public static void teardown() {
}
@MethodSource("syncTestCases")
@ParameterizedTest
public void syncClient_usesCorrectEndpoint(SyncTestCase tc) {
runAndVerify(tc);
}
@MethodSource("asyncTestCases")
@ParameterizedTest
public void asyncClient_usesCorrectEndpoint(AsyncTestCase tc) {
runAndVerify(tc);
}
private static List<SyncTestCase> syncTestCases() {
return Arrays.asList(
new SyncTestCase("test case 3", () -> {
QueryClientBuilder builder = QueryClient.builder();
builder.credentialsProvider(BaseRuleSetClientTest.CREDENTIALS_PROVIDER);
builder.tokenProvider(BaseRuleSetClientTest.TOKEN_PROVIDER);
builder.httpClient(getSyncHttpClient());
builder.region(Region.of("us-east-1"));
OperationWithContextParamRequest request = OperationWithContextParamRequest.builder()
.stringMember("this is a test").build();
builder.build().operationWithContextParam(request);
}, Expect.builder().endpoint(Endpoint.builder().url(URI.create("https://myservice.aws")).build()).build()),
new SyncTestCase("test case 4", () -> {
QueryClientBuilder builder = QueryClient.builder();
builder.credentialsProvider(BaseRuleSetClientTest.CREDENTIALS_PROVIDER);
builder.tokenProvider(BaseRuleSetClientTest.TOKEN_PROVIDER);
builder.httpClient(getSyncHttpClient());
builder.region(Region.of("us-east-6"));
OperationWithContextParamRequest request = OperationWithContextParamRequest.builder()
.stringMember("this is a test").build();
builder.build().operationWithContextParam(request);
}, Expect.builder().endpoint(Endpoint.builder().url(URI.create("https://myservice.aws")).build()).build(),
"Does not work"),
new SyncTestCase("Has complex operation input", () -> {
QueryClientBuilder builder = QueryClient.builder();
builder.credentialsProvider(BaseRuleSetClientTest.CREDENTIALS_PROVIDER);
builder.tokenProvider(BaseRuleSetClientTest.TOKEN_PROVIDER);
builder.httpClient(getSyncHttpClient());
OperationWithContextParamRequest request = OperationWithContextParamRequest.builder()
.nestedMember(ChecksumStructure.builder().checksumMode("foo").build()).build();
builder.build().operationWithContextParam(request);
}, Expect.builder().error("Missing info").build()));
}
private static List<AsyncTestCase> asyncTestCases() {
return Arrays.asList(
new AsyncTestCase("test case 3", () -> {
QueryAsyncClientBuilder builder = QueryAsyncClient.builder();
builder.credentialsProvider(BaseRuleSetClientTest.CREDENTIALS_PROVIDER);
builder.tokenProvider(BaseRuleSetClientTest.TOKEN_PROVIDER);
builder.httpClient(getAsyncHttpClient());
builder.region(Region.of("us-east-1"));
OperationWithContextParamRequest request = OperationWithContextParamRequest.builder()
.stringMember("this is a test").build();
return builder.build().operationWithContextParam(request);
}, Expect.builder().endpoint(Endpoint.builder().url(URI.create("https://myservice.aws")).build()).build()),
new AsyncTestCase("test case 4", () -> {
QueryAsyncClientBuilder builder = QueryAsyncClient.builder();
builder.credentialsProvider(BaseRuleSetClientTest.CREDENTIALS_PROVIDER);
builder.tokenProvider(BaseRuleSetClientTest.TOKEN_PROVIDER);
builder.httpClient(getAsyncHttpClient());
builder.region(Region.of("us-east-6"));
OperationWithContextParamRequest request = OperationWithContextParamRequest.builder()
.stringMember("this is a test").build();
return builder.build().operationWithContextParam(request);
}, Expect.builder().endpoint(Endpoint.builder().url(URI.create("https://myservice.aws")).build()).build(),
"Does not work"),
new AsyncTestCase("Has complex operation input", () -> {
QueryAsyncClientBuilder builder = QueryAsyncClient.builder();
builder.credentialsProvider(BaseRuleSetClientTest.CREDENTIALS_PROVIDER);
builder.tokenProvider(BaseRuleSetClientTest.TOKEN_PROVIDER);
builder.httpClient(getAsyncHttpClient());
OperationWithContextParamRequest request = OperationWithContextParamRequest.builder()
.nestedMember(ChecksumStructure.builder().checksumMode("foo").build()).build();
return builder.build().operationWithContextParam(request);
}, Expect.builder().error("Missing info").build()));
}
}
| 3,494 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/builder/test-client-builder-class.java | package software.amazon.awssdk.services.json;
import java.util.ArrayList;
import java.util.List;
import software.amazon.MyServiceHttpConfig;
import software.amazon.MyServiceRetryPolicy;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.annotations.SdkInternalApi;
import software.amazon.awssdk.auth.credentials.TokenUtils;
import software.amazon.awssdk.auth.signer.Aws4Signer;
import software.amazon.awssdk.auth.token.credentials.aws.DefaultAwsTokenProvider;
import software.amazon.awssdk.auth.token.signer.aws.BearerTokenSigner;
import software.amazon.awssdk.awscore.client.builder.AwsDefaultClientBuilder;
import software.amazon.awssdk.awscore.client.config.AwsClientOption;
import software.amazon.awssdk.codegen.poet.plugins.InternalTestPlugin1;
import software.amazon.awssdk.codegen.poet.plugins.InternalTestPlugin2;
import software.amazon.awssdk.core.SdkPlugin;
import software.amazon.awssdk.core.client.config.SdkAdvancedClientOption;
import software.amazon.awssdk.core.client.config.SdkClientConfiguration;
import software.amazon.awssdk.core.client.config.SdkClientOption;
import software.amazon.awssdk.core.interceptor.ClasspathInterceptorChainFactory;
import software.amazon.awssdk.core.interceptor.ExecutionInterceptor;
import software.amazon.awssdk.core.signer.Signer;
import software.amazon.awssdk.identity.spi.IdentityProvider;
import software.amazon.awssdk.identity.spi.IdentityProviders;
import software.amazon.awssdk.identity.spi.TokenIdentity;
import software.amazon.awssdk.services.json.endpoints.JsonClientContextParams;
import software.amazon.awssdk.services.json.endpoints.JsonEndpointProvider;
import software.amazon.awssdk.services.json.endpoints.internal.JsonRequestSetEndpointInterceptor;
import software.amazon.awssdk.services.json.endpoints.internal.JsonResolveEndpointInterceptor;
import software.amazon.awssdk.services.json.internal.JsonServiceClientConfigurationBuilder;
import software.amazon.awssdk.utils.AttributeMap;
import software.amazon.awssdk.utils.CollectionUtils;
import software.amazon.awssdk.utils.Validate;
/**
* Internal base class for {@link DefaultJsonClientBuilder} and {@link DefaultJsonAsyncClientBuilder}.
*/
@Generated("software.amazon.awssdk:codegen")
@SdkInternalApi
abstract class DefaultJsonBaseClientBuilder<B extends JsonBaseClientBuilder<B, C>, C> extends AwsDefaultClientBuilder<B, C> {
@Override
protected final String serviceEndpointPrefix() {
return "json-service-endpoint";
}
@Override
protected final String serviceName() {
return "Json";
}
@Override
protected final SdkClientConfiguration mergeServiceDefaults(SdkClientConfiguration config) {
return config.merge(c -> c
.option(SdkClientOption.ENDPOINT_PROVIDER, defaultEndpointProvider())
.option(SdkAdvancedClientOption.SIGNER, defaultSigner())
.option(SdkClientOption.CRC32_FROM_COMPRESSED_DATA_ENABLED, false)
.option(SdkClientOption.SERVICE_CONFIGURATION, ServiceConfiguration.builder().build())
.lazyOption(AwsClientOption.TOKEN_PROVIDER,
p -> TokenUtils.toSdkTokenProvider(p.get(AwsClientOption.TOKEN_IDENTITY_PROVIDER)))
.option(AwsClientOption.TOKEN_IDENTITY_PROVIDER, defaultTokenProvider())
.option(SdkAdvancedClientOption.TOKEN_SIGNER, defaultTokenSigner()));
}
@Override
protected final SdkClientConfiguration finalizeServiceConfiguration(SdkClientConfiguration config) {
List<ExecutionInterceptor> endpointInterceptors = new ArrayList<>();
endpointInterceptors.add(new JsonResolveEndpointInterceptor());
endpointInterceptors.add(new JsonRequestSetEndpointInterceptor());
ClasspathInterceptorChainFactory interceptorFactory = new ClasspathInterceptorChainFactory();
List<ExecutionInterceptor> interceptors = interceptorFactory
.getInterceptors("software/amazon/awssdk/services/json/execution.interceptors");
List<ExecutionInterceptor> additionalInterceptors = new ArrayList<>();
interceptors = CollectionUtils.mergeLists(endpointInterceptors, interceptors);
interceptors = CollectionUtils.mergeLists(interceptors, additionalInterceptors);
interceptors = CollectionUtils.mergeLists(interceptors, config.option(SdkClientOption.EXECUTION_INTERCEPTORS));
ServiceConfiguration.Builder serviceConfigBuilder = ((ServiceConfiguration) config
.option(SdkClientOption.SERVICE_CONFIGURATION)).toBuilder();
serviceConfigBuilder.profileFile(serviceConfigBuilder.profileFileSupplier() != null ? serviceConfigBuilder
.profileFileSupplier() : config.option(SdkClientOption.PROFILE_FILE_SUPPLIER));
serviceConfigBuilder.profileName(serviceConfigBuilder.profileName() != null ? serviceConfigBuilder.profileName() : config
.option(SdkClientOption.PROFILE_NAME));
if (serviceConfigBuilder.dualstackEnabled() != null) {
Validate.validState(
config.option(AwsClientOption.DUALSTACK_ENDPOINT_ENABLED) == null,
"Dualstack has been configured on both ServiceConfiguration and the client/global level. Please limit dualstack configuration to one location.");
} else {
serviceConfigBuilder.dualstackEnabled(config.option(AwsClientOption.DUALSTACK_ENDPOINT_ENABLED));
}
if (serviceConfigBuilder.fipsModeEnabled() != null) {
Validate.validState(
config.option(AwsClientOption.FIPS_ENDPOINT_ENABLED) == null,
"Fips has been configured on both ServiceConfiguration and the client/global level. Please limit fips configuration to one location.");
} else {
serviceConfigBuilder.fipsModeEnabled(config.option(AwsClientOption.FIPS_ENDPOINT_ENABLED));
}
if (serviceConfigBuilder.useArnRegionEnabled() != null) {
Validate.validState(
clientContextParams.get(JsonClientContextParams.USE_ARN_REGION) == null,
"UseArnRegion has been configured on both ServiceConfiguration and the client/global level. Please limit UseArnRegion configuration to one location.");
} else {
serviceConfigBuilder.useArnRegionEnabled(clientContextParams.get(JsonClientContextParams.USE_ARN_REGION));
}
if (serviceConfigBuilder.multiRegionEnabled() != null) {
Validate.validState(
clientContextParams.get(JsonClientContextParams.DISABLE_MULTI_REGION_ACCESS_POINTS) == null,
"DisableMultiRegionAccessPoints has been configured on both ServiceConfiguration and the client/global level. Please limit DisableMultiRegionAccessPoints configuration to one location.");
} else if (clientContextParams.get(JsonClientContextParams.DISABLE_MULTI_REGION_ACCESS_POINTS) != null) {
serviceConfigBuilder.multiRegionEnabled(!clientContextParams
.get(JsonClientContextParams.DISABLE_MULTI_REGION_ACCESS_POINTS));
}
if (serviceConfigBuilder.pathStyleAccessEnabled() != null) {
Validate.validState(
clientContextParams.get(JsonClientContextParams.FORCE_PATH_STYLE) == null,
"ForcePathStyle has been configured on both ServiceConfiguration and the client/global level. Please limit ForcePathStyle configuration to one location.");
} else {
serviceConfigBuilder.pathStyleAccessEnabled(clientContextParams.get(JsonClientContextParams.FORCE_PATH_STYLE));
}
if (serviceConfigBuilder.accelerateModeEnabled() != null) {
Validate.validState(
clientContextParams.get(JsonClientContextParams.ACCELERATE) == null,
"Accelerate has been configured on both ServiceConfiguration and the client/global level. Please limit Accelerate configuration to one location.");
} else {
serviceConfigBuilder.accelerateModeEnabled(clientContextParams.get(JsonClientContextParams.ACCELERATE));
}
ServiceConfiguration finalServiceConfig = serviceConfigBuilder.build();
clientContextParams.put(JsonClientContextParams.USE_ARN_REGION, finalServiceConfig.useArnRegionEnabled());
clientContextParams.put(JsonClientContextParams.DISABLE_MULTI_REGION_ACCESS_POINTS,
!finalServiceConfig.multiRegionEnabled());
clientContextParams.put(JsonClientContextParams.FORCE_PATH_STYLE, finalServiceConfig.pathStyleAccessEnabled());
clientContextParams.put(JsonClientContextParams.ACCELERATE, finalServiceConfig.accelerateModeEnabled());
SdkClientConfiguration.Builder builder = config.toBuilder();
builder.lazyOption(SdkClientOption.IDENTITY_PROVIDERS, c -> {
IdentityProviders.Builder result = IdentityProviders.builder();
IdentityProvider<?> tokenIdentityProvider = c.get(AwsClientOption.TOKEN_IDENTITY_PROVIDER);
if (tokenIdentityProvider != null) {
result.putIdentityProvider(tokenIdentityProvider);
}
IdentityProvider<?> credentialsIdentityProvider = c.get(AwsClientOption.CREDENTIALS_IDENTITY_PROVIDER);
if (credentialsIdentityProvider != null) {
result.putIdentityProvider(credentialsIdentityProvider);
}
return result.build();
});
builder.option(SdkClientOption.EXECUTION_INTERCEPTORS, interceptors)
.option(AwsClientOption.DUALSTACK_ENDPOINT_ENABLED, finalServiceConfig.dualstackEnabled())
.option(AwsClientOption.FIPS_ENDPOINT_ENABLED, finalServiceConfig.fipsModeEnabled())
.option(SdkClientOption.RETRY_POLICY, MyServiceRetryPolicy.resolveRetryPolicy(config))
.option(SdkClientOption.SERVICE_CONFIGURATION, finalServiceConfig);
return builder.build();
}
private Signer defaultSigner() {
return Aws4Signer.create();
}
@Override
protected final String signingName() {
return "json-service";
}
private JsonEndpointProvider defaultEndpointProvider() {
return JsonEndpointProvider.defaultProvider();
}
public B serviceConfiguration(ServiceConfiguration serviceConfiguration) {
clientConfiguration.option(SdkClientOption.SERVICE_CONFIGURATION, serviceConfiguration);
return thisBuilder();
}
public void setServiceConfiguration(ServiceConfiguration serviceConfiguration) {
serviceConfiguration(serviceConfiguration);
}
private IdentityProvider<? extends TokenIdentity> defaultTokenProvider() {
return DefaultAwsTokenProvider.create();
}
private Signer defaultTokenSigner() {
return BearerTokenSigner.create();
}
@Override
protected final AttributeMap serviceHttpConfig() {
AttributeMap result = MyServiceHttpConfig.defaultHttpConfig();
return result;
}
@Override
protected SdkClientConfiguration invokePlugins(SdkClientConfiguration config) {
List<SdkPlugin> internalPlugins = internalPlugins();
List<SdkPlugin> externalPlugins = plugins();
if (internalPlugins.isEmpty() && externalPlugins.isEmpty()) {
return config;
}
List<SdkPlugin> plugins = CollectionUtils.mergeLists(internalPlugins, externalPlugins);
SdkClientConfiguration.Builder configuration = config.toBuilder();
JsonServiceClientConfigurationBuilder serviceConfigBuilder = new JsonServiceClientConfigurationBuilder(configuration);
for (SdkPlugin plugin : plugins) {
plugin.configureClient(serviceConfigBuilder);
}
return configuration.build();
}
private List<SdkPlugin> internalPlugins() {
List<SdkPlugin> internalPlugins = new ArrayList<>();
internalPlugins.add(new InternalTestPlugin1());
internalPlugins.add(new InternalTestPlugin2());
return internalPlugins;
}
protected static void validateClientOptions(SdkClientConfiguration c) {
Validate.notNull(c.option(SdkAdvancedClientOption.SIGNER),
"The 'overrideConfiguration.advancedOption[SIGNER]' must be configured in the client builder.");
Validate.notNull(c.option(SdkAdvancedClientOption.TOKEN_SIGNER),
"The 'overrideConfiguration.advancedOption[TOKEN_SIGNER]' must be configured in the client builder.");
Validate.notNull(c.option(AwsClientOption.TOKEN_IDENTITY_PROVIDER),
"The 'tokenProvider' must be configured in the client builder.");
}
}
| 3,495 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/builder/test-composed-sync-default-client-builder.java | package software.amazon.awssdk.services.json;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.annotations.SdkInternalApi;
import software.amazon.awssdk.auth.credentials.TokenUtils;
import software.amazon.awssdk.auth.signer.Aws4Signer;
import software.amazon.awssdk.auth.token.credentials.aws.DefaultAwsTokenProvider;
import software.amazon.awssdk.auth.token.signer.aws.BearerTokenSigner;
import software.amazon.awssdk.awscore.client.builder.AwsDefaultClientBuilder;
import software.amazon.awssdk.awscore.client.config.AwsClientOption;
import software.amazon.awssdk.core.SdkPlugin;
import software.amazon.awssdk.core.client.config.SdkAdvancedClientOption;
import software.amazon.awssdk.core.client.config.SdkClientConfiguration;
import software.amazon.awssdk.core.client.config.SdkClientOption;
import software.amazon.awssdk.core.interceptor.ClasspathInterceptorChainFactory;
import software.amazon.awssdk.core.interceptor.ExecutionInterceptor;
import software.amazon.awssdk.core.signer.Signer;
import software.amazon.awssdk.identity.spi.IdentityProvider;
import software.amazon.awssdk.identity.spi.IdentityProviders;
import software.amazon.awssdk.identity.spi.TokenIdentity;
import software.amazon.awssdk.services.json.endpoints.JsonClientContextParams;
import software.amazon.awssdk.services.json.endpoints.JsonEndpointProvider;
import software.amazon.awssdk.services.json.endpoints.internal.JsonRequestSetEndpointInterceptor;
import software.amazon.awssdk.services.json.endpoints.internal.JsonResolveEndpointInterceptor;
import software.amazon.awssdk.services.json.internal.JsonServiceClientConfigurationBuilder;
import software.amazon.awssdk.utils.CollectionUtils;
import software.amazon.awssdk.utils.Validate;
/**
* Internal base class for {@link DefaultJsonClientBuilder} and {@link DefaultJsonAsyncClientBuilder}.
*/
@Generated("software.amazon.awssdk:codegen")
@SdkInternalApi
abstract class DefaultJsonBaseClientBuilder<B extends JsonBaseClientBuilder<B, C>, C> extends AwsDefaultClientBuilder<B, C> {
@Override
protected final String serviceEndpointPrefix() {
return "json-service-endpoint";
}
@Override
protected final String serviceName() {
return "Json";
}
@Override
protected final SdkClientConfiguration mergeServiceDefaults(SdkClientConfiguration config) {
return config.merge(c -> c
.option(SdkClientOption.ENDPOINT_PROVIDER, defaultEndpointProvider())
.option(SdkAdvancedClientOption.SIGNER, defaultSigner())
.option(SdkClientOption.CRC32_FROM_COMPRESSED_DATA_ENABLED, false)
.option(SdkClientOption.SERVICE_CONFIGURATION, ServiceConfiguration.builder().build())
.lazyOption(AwsClientOption.TOKEN_PROVIDER,
p -> TokenUtils.toSdkTokenProvider(p.get(AwsClientOption.TOKEN_IDENTITY_PROVIDER)))
.option(AwsClientOption.TOKEN_IDENTITY_PROVIDER, defaultTokenProvider())
.option(SdkAdvancedClientOption.TOKEN_SIGNER, defaultTokenSigner()));
}
@Override
protected final SdkClientConfiguration finalizeServiceConfiguration(SdkClientConfiguration config) {
List<ExecutionInterceptor> endpointInterceptors = new ArrayList<>();
endpointInterceptors.add(new JsonResolveEndpointInterceptor());
endpointInterceptors.add(new JsonRequestSetEndpointInterceptor());
ClasspathInterceptorChainFactory interceptorFactory = new ClasspathInterceptorChainFactory();
List<ExecutionInterceptor> interceptors = interceptorFactory
.getInterceptors("software/amazon/awssdk/services/json/execution.interceptors");
List<ExecutionInterceptor> additionalInterceptors = new ArrayList<>();
interceptors = CollectionUtils.mergeLists(endpointInterceptors, interceptors);
interceptors = CollectionUtils.mergeLists(interceptors, additionalInterceptors);
interceptors = CollectionUtils.mergeLists(interceptors, config.option(SdkClientOption.EXECUTION_INTERCEPTORS));
ServiceConfiguration.Builder serviceConfigBuilder = ((ServiceConfiguration) config
.option(SdkClientOption.SERVICE_CONFIGURATION)).toBuilder();
serviceConfigBuilder.profileFile(serviceConfigBuilder.profileFileSupplier() != null ? serviceConfigBuilder
.profileFileSupplier() : config.option(SdkClientOption.PROFILE_FILE_SUPPLIER));
serviceConfigBuilder.profileName(serviceConfigBuilder.profileName() != null ? serviceConfigBuilder.profileName() : config
.option(SdkClientOption.PROFILE_NAME));
ServiceConfiguration finalServiceConfig = serviceConfigBuilder.build();
SdkClientConfiguration.Builder builder = config.toBuilder();
builder.lazyOption(SdkClientOption.IDENTITY_PROVIDERS, c -> {
IdentityProviders.Builder result = IdentityProviders.builder();
IdentityProvider<?> tokenIdentityProvider = c.get(AwsClientOption.TOKEN_IDENTITY_PROVIDER);
if (tokenIdentityProvider != null) {
result.putIdentityProvider(tokenIdentityProvider);
}
IdentityProvider<?> credentialsIdentityProvider = c.get(AwsClientOption.CREDENTIALS_IDENTITY_PROVIDER);
if (credentialsIdentityProvider != null) {
result.putIdentityProvider(credentialsIdentityProvider);
}
return result.build();
});
builder.option(SdkClientOption.EXECUTION_INTERCEPTORS, interceptors).option(SdkClientOption.SERVICE_CONFIGURATION,
finalServiceConfig);
return builder.build();
}
private Signer defaultSigner() {
return Aws4Signer.create();
}
@Override
protected final String signingName() {
return "json-service";
}
private JsonEndpointProvider defaultEndpointProvider() {
return JsonEndpointProvider.defaultProvider();
}
public B customParameter(Boolean customParameter) {
clientContextParams.put(JsonClientContextParams.CUSTOM_PARAMETER, customParameter);
return thisBuilder();
}
public B serviceConfiguration(ServiceConfiguration serviceConfiguration) {
clientConfiguration.option(SdkClientOption.SERVICE_CONFIGURATION, serviceConfiguration);
return thisBuilder();
}
public void setServiceConfiguration(ServiceConfiguration serviceConfiguration) {
serviceConfiguration(serviceConfiguration);
}
private IdentityProvider<? extends TokenIdentity> defaultTokenProvider() {
return DefaultAwsTokenProvider.create();
}
private Signer defaultTokenSigner() {
return BearerTokenSigner.create();
}
@Override
protected SdkClientConfiguration invokePlugins(SdkClientConfiguration config) {
List<SdkPlugin> internalPlugins = internalPlugins();
List<SdkPlugin> externalPlugins = plugins();
if (internalPlugins.isEmpty() && externalPlugins.isEmpty()) {
return config;
}
List<SdkPlugin> plugins = CollectionUtils.mergeLists(internalPlugins, externalPlugins);
SdkClientConfiguration.Builder configuration = config.toBuilder();
JsonServiceClientConfigurationBuilder serviceConfigBuilder = new JsonServiceClientConfigurationBuilder(configuration);
for (SdkPlugin plugin : plugins) {
plugin.configureClient(serviceConfigBuilder);
}
return configuration.build();
}
private List<SdkPlugin> internalPlugins() {
return Collections.emptyList();
}
protected static void validateClientOptions(SdkClientConfiguration c) {
Validate.notNull(c.option(SdkAdvancedClientOption.SIGNER),
"The 'overrideConfiguration.advancedOption[SIGNER]' must be configured in the client builder.");
Validate.notNull(c.option(SdkAdvancedClientOption.TOKEN_SIGNER),
"The 'overrideConfiguration.advancedOption[TOKEN_SIGNER]' must be configured in the client builder.");
Validate.notNull(c.option(AwsClientOption.TOKEN_IDENTITY_PROVIDER),
"The 'tokenProvider' must be configured in the client builder.");
}
}
| 3,496 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/builder/test-composed-sync-client-builder-class.java | package software.amazon.awssdk.services.json;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.annotations.SdkInternalApi;
import software.amazon.awssdk.awscore.client.config.AwsClientOption;
import software.amazon.awssdk.core.client.config.SdkClientConfiguration;
import software.amazon.awssdk.core.client.config.SdkClientOption;
import software.amazon.awssdk.identity.spi.IdentityProvider;
import software.amazon.awssdk.identity.spi.TokenIdentity;
import software.amazon.awssdk.services.builder.SyncClientDecorator;
import software.amazon.awssdk.services.json.endpoints.JsonEndpointProvider;
/**
* Internal implementation of {@link JsonClientBuilder}.
*/
@Generated("software.amazon.awssdk:codegen")
@SdkInternalApi
final class DefaultJsonClientBuilder extends DefaultJsonBaseClientBuilder<JsonClientBuilder, JsonClient> implements
JsonClientBuilder {
@Override
public DefaultJsonClientBuilder endpointProvider(JsonEndpointProvider endpointProvider) {
clientConfiguration.option(SdkClientOption.ENDPOINT_PROVIDER, endpointProvider);
return this;
}
@Override
public DefaultJsonClientBuilder tokenProvider(IdentityProvider<? extends TokenIdentity> tokenProvider) {
clientConfiguration.option(AwsClientOption.TOKEN_IDENTITY_PROVIDER, tokenProvider);
return this;
}
@Override
protected final JsonClient buildClient() {
SdkClientConfiguration clientConfiguration = super.syncClientConfiguration();
this.validateClientOptions(clientConfiguration);
JsonClient client = new DefaultJsonClient(clientConfiguration);
return new SyncClientDecorator().decorate(client, clientConfiguration, clientContextParams.copy().build());
}
}
| 3,497 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/builder/test-no-auth-service-client-builder-class.java | package software.amazon.awssdk.services.database;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.annotations.SdkInternalApi;
import software.amazon.awssdk.awscore.client.builder.AwsDefaultClientBuilder;
import software.amazon.awssdk.core.SdkPlugin;
import software.amazon.awssdk.core.client.config.SdkClientConfiguration;
import software.amazon.awssdk.core.client.config.SdkClientOption;
import software.amazon.awssdk.core.interceptor.ClasspathInterceptorChainFactory;
import software.amazon.awssdk.core.interceptor.ExecutionInterceptor;
import software.amazon.awssdk.identity.spi.IdentityProviders;
import software.amazon.awssdk.services.database.endpoints.DatabaseEndpointProvider;
import software.amazon.awssdk.services.database.endpoints.internal.DatabaseRequestSetEndpointInterceptor;
import software.amazon.awssdk.services.database.endpoints.internal.DatabaseResolveEndpointInterceptor;
import software.amazon.awssdk.services.database.internal.DatabaseServiceClientConfigurationBuilder;
import software.amazon.awssdk.utils.CollectionUtils;
/**
* Internal base class for {@link DefaultDatabaseClientBuilder} and {@link DefaultDatabaseAsyncClientBuilder}.
*/
@Generated("software.amazon.awssdk:codegen")
@SdkInternalApi
abstract class DefaultDatabaseBaseClientBuilder<B extends DatabaseBaseClientBuilder<B, C>, C> extends
AwsDefaultClientBuilder<B, C> {
@Override
protected final String serviceEndpointPrefix() {
return "database-service-endpoint";
}
@Override
protected final String serviceName() {
return "Database";
}
@Override
protected final SdkClientConfiguration mergeServiceDefaults(SdkClientConfiguration config) {
return config.merge(c -> c.option(SdkClientOption.ENDPOINT_PROVIDER, defaultEndpointProvider()).option(
SdkClientOption.CRC32_FROM_COMPRESSED_DATA_ENABLED, false));
}
@Override
protected final SdkClientConfiguration finalizeServiceConfiguration(SdkClientConfiguration config) {
List<ExecutionInterceptor> endpointInterceptors = new ArrayList<>();
endpointInterceptors.add(new DatabaseResolveEndpointInterceptor());
endpointInterceptors.add(new DatabaseRequestSetEndpointInterceptor());
ClasspathInterceptorChainFactory interceptorFactory = new ClasspathInterceptorChainFactory();
List<ExecutionInterceptor> interceptors = interceptorFactory
.getInterceptors("software/amazon/awssdk/services/database/execution.interceptors");
List<ExecutionInterceptor> additionalInterceptors = new ArrayList<>();
interceptors = CollectionUtils.mergeLists(endpointInterceptors, interceptors);
interceptors = CollectionUtils.mergeLists(interceptors, additionalInterceptors);
interceptors = CollectionUtils.mergeLists(interceptors, config.option(SdkClientOption.EXECUTION_INTERCEPTORS));
SdkClientConfiguration.Builder builder = config.toBuilder();
builder.lazyOption(SdkClientOption.IDENTITY_PROVIDERS, c -> {
IdentityProviders.Builder result = IdentityProviders.builder();
return result.build();
});
builder.option(SdkClientOption.EXECUTION_INTERCEPTORS, interceptors);
return builder.build();
}
@Override
protected final String signingName() {
return "database-service";
}
private DatabaseEndpointProvider defaultEndpointProvider() {
return DatabaseEndpointProvider.defaultProvider();
}
@Override
protected SdkClientConfiguration invokePlugins(SdkClientConfiguration config) {
List<SdkPlugin> internalPlugins = internalPlugins();
List<SdkPlugin> externalPlugins = plugins();
if (internalPlugins.isEmpty() && externalPlugins.isEmpty()) {
return config;
}
List<SdkPlugin> plugins = CollectionUtils.mergeLists(internalPlugins, externalPlugins);
SdkClientConfiguration.Builder configuration = config.toBuilder();
DatabaseServiceClientConfigurationBuilder serviceConfigBuilder = new DatabaseServiceClientConfigurationBuilder(
configuration);
for (SdkPlugin plugin : plugins) {
plugin.configureClient(serviceConfigBuilder);
}
return configuration.build();
}
private List<SdkPlugin> internalPlugins() {
return Collections.emptyList();
}
protected static void validateClientOptions(SdkClientConfiguration c) {
}
}
| 3,498 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/builder/test-sync-client-builder-class.java | package software.amazon.awssdk.services.json;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.annotations.SdkInternalApi;
import software.amazon.awssdk.awscore.client.config.AwsClientOption;
import software.amazon.awssdk.core.client.config.SdkClientConfiguration;
import software.amazon.awssdk.core.client.config.SdkClientOption;
import software.amazon.awssdk.identity.spi.IdentityProvider;
import software.amazon.awssdk.identity.spi.TokenIdentity;
import software.amazon.awssdk.services.json.endpoints.JsonEndpointProvider;
/**
* Internal implementation of {@link JsonClientBuilder}.
*/
@Generated("software.amazon.awssdk:codegen")
@SdkInternalApi
final class DefaultJsonClientBuilder extends DefaultJsonBaseClientBuilder<JsonClientBuilder, JsonClient> implements
JsonClientBuilder {
@Override
public DefaultJsonClientBuilder endpointProvider(JsonEndpointProvider endpointProvider) {
clientConfiguration.option(SdkClientOption.ENDPOINT_PROVIDER, endpointProvider);
return this;
}
@Override
public DefaultJsonClientBuilder tokenProvider(IdentityProvider<? extends TokenIdentity> tokenProvider) {
clientConfiguration.option(AwsClientOption.TOKEN_IDENTITY_PROVIDER, tokenProvider);
return this;
}
@Override
protected final JsonClient buildClient() {
SdkClientConfiguration clientConfiguration = super.syncClientConfiguration();
this.validateClientOptions(clientConfiguration);
JsonClient client = new DefaultJsonClient(clientConfiguration);
return client;
}
}
| 3,499 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.