From f3e9dc58e3da45c28b5283ddb3251e4bf9a9cd2e Mon Sep 17 00:00:00 2001
From: Manuel Sugawara
Date: Mon, 4 Nov 2024 11:32:43 -0800
Subject: [PATCH] Consolidate unmarshalling and parsing in a single pass
(#5643)
* Consolidate unmarshalling and parsing in a single pass
* Address PR comments
* Address PR comments
* Add a test to assert that a non-object literal throws
* Add more testing
* Use Jackson's built-in fast float parsing
* Add customizaion option to enable the fast unmarshalling path
* Fix checkstyle issues
* Account for tests with unset clientConfiguration
* Fix codegen checkstyle
---
.../feature-AWSSDKforJavav2-70d110c.json | 6 +
.../customization/CustomizationConfig.java | 12 +
.../poet/builder/BaseClientBuilderClass.java | 8 +
.../codegen/poet/model/AwsServiceModel.java | 15 +-
.../codegen/poet/model/ModelBuilderSpecs.java | 13 +
.../codegen/poet/model/ShapeModelSpec.java | 49 +-
.../codegen/poet/model/alltypesrequest.java | 53 +
.../codegen/poet/model/alltypesresponse.java | 53 +
.../poet/model/alltypesunionstructure.java | 1176 +++++++++--------
.../awssdk/codegen/poet/model/basetype.java | 53 +-
.../poet/model/deprecatedrenamerequest.java | 62 +-
.../poet/model/deprecatedrenameresponse.java | 62 +-
.../poet/model/emptymodeledexception.java | 17 +-
.../awssdk/codegen/poet/model/enumtype.java | 12 +-
.../awssdk/codegen/poet/model/eventone.java | 33 +-
.../codegen/poet/model/eventstream.java | 1 -
.../model/eventstreamoperationrequest.java | 16 +-
.../model/eventstreamoperationresponse.java | 17 +-
...ntstreamoperationwithonlyinputrequest.java | 16 +-
...tstreamoperationwithonlyinputresponse.java | 17 +-
.../awssdk/codegen/poet/model/eventtwo.java | 33 +-
...onserviceinternalservererrorexception.java | 16 +-
.../jsonserviceinvalidinputexception.java | 16 +-
.../jsonservicethrottlingexception.java | 16 +-
.../model/existencechecknamingrequest.java | 161 ++-
.../model/existencechecknamingresponse.java | 161 ++-
.../awssdk/codegen/poet/model/inputevent.java | 43 +-
.../codegen/poet/model/inputeventstream.java | 1 -
.../poet/model/inputeventstreamtwo.java | 1 -
.../codegen/poet/model/inputeventtwo.java | 77 +-
.../poet/model/nestedcontainersrequest.java | 260 ++--
.../poet/model/nestedcontainersresponse.java | 262 ++--
.../model/nestedqueryparameteroperation.java | 65 +-
.../operationwithdeprecatedmemberrequest.java | 114 +-
...operationwithdeprecatedmemberresponse.java | 89 +-
.../operationwithnoinputoroutputrequest.java | 16 +-
.../operationwithnoinputoroutputresponse.java | 17 +-
.../model/queryparameteroperationrequest.java | 226 ++--
.../queryparameteroperationresponse.java | 20 +-
.../poet/model/recursivestructtype.java | 131 +-
.../poet/model/sharedstream/eventstream.java | 1 -
.../sharedstream/getrandompersonrequest.java | 16 +-
.../sharedstream/getrandompersonresponse.java | 48 +-
.../poet/model/sharedstream/person.java | 44 +-
.../sharedstream/streambirthsrequest.java | 16 +-
.../sharedstream/streambirthsresponse.java | 16 +-
.../sharedstream/streamdeathsrequest.java | 16 +-
.../sharedstream/streamdeathsresponse.java | 16 +-
.../codegen/poet/model/simplestruct.java | 33 +-
.../model/streaminginputoperationrequest.java | 16 +-
.../streaminginputoperationresponse.java | 17 +-
.../streamingoutputoperationrequest.java | 16 +-
.../streamingoutputoperationresponse.java | 17 +-
.../poet/model/structwithnestedblobtype.java | 35 +-
.../poet/model/structwithtimestamp.java | 37 +-
.../awssdk/codegen/poet/model/subtypeone.java | 35 +-
.../poet/model/underscore_name_type.java | 17 +-
.../xmlnamespace/testxmlnamespacerequest.java | 105 +-
.../testxmlnamespaceresponse.java | 105 +-
.../xmlnamespace/xmlnamespacemember.java | 64 +-
.../json/BaseAwsJsonProtocolFactory.java | 10 +
.../AwsStructuredPlainJsonFactory.java | 14 +-
.../unmarshall/JsonProtocolUnmarshaller.java | 131 +-
.../unmarshall/JsonUnmarshallingParser.java | 540 ++++++++
.../SdkClientJsonProtocolAdvancedOption.java | 32 +
.../internal/unmarshall/ComplexStructure.java | 787 +++++++++++
.../JsonUnmarshallingParserTest.java | 119 ++
.../unmarshall/ListOfStringsCopier.java | 36 +
.../unmarshall/MapOfStringToStringCopier.java | 38 +
.../json/internal/unmarshall/TestRequest.java | 822 ++++++++++++
.../amazon/awssdk/core/SdkNumber.java | 38 +-
.../software/amazon/awssdk/core/SdkPojo.java | 8 +
.../amazon/awssdk/core/document/Document.java | 19 +-
.../suites/cases/rest-json-output.json | 26 +-
.../codegen-resources/restjson/service-2.json | 40 +
.../benchmark/apicall/protocol/JsonCodec.java | 2 +-
.../dynamodb/V2DynamoDbAttributeValue.java | 2 +
77 files changed, 5182 insertions(+), 1568 deletions(-)
create mode 100644 .changes/next-release/feature-AWSSDKforJavav2-70d110c.json
create mode 100644 core/protocols/aws-json-protocol/src/main/java/software/amazon/awssdk/protocols/json/internal/unmarshall/JsonUnmarshallingParser.java
create mode 100644 core/protocols/aws-json-protocol/src/main/java/software/amazon/awssdk/protocols/json/internal/unmarshall/SdkClientJsonProtocolAdvancedOption.java
create mode 100644 core/protocols/aws-json-protocol/src/test/java/software/amazon/awssdk/protocols/json/internal/unmarshall/ComplexStructure.java
create mode 100644 core/protocols/aws-json-protocol/src/test/java/software/amazon/awssdk/protocols/json/internal/unmarshall/JsonUnmarshallingParserTest.java
create mode 100644 core/protocols/aws-json-protocol/src/test/java/software/amazon/awssdk/protocols/json/internal/unmarshall/ListOfStringsCopier.java
create mode 100644 core/protocols/aws-json-protocol/src/test/java/software/amazon/awssdk/protocols/json/internal/unmarshall/MapOfStringToStringCopier.java
create mode 100644 core/protocols/aws-json-protocol/src/test/java/software/amazon/awssdk/protocols/json/internal/unmarshall/TestRequest.java
diff --git a/.changes/next-release/feature-AWSSDKforJavav2-70d110c.json b/.changes/next-release/feature-AWSSDKforJavav2-70d110c.json
new file mode 100644
index 000000000000..a17d92f4bb55
--- /dev/null
+++ b/.changes/next-release/feature-AWSSDKforJavav2-70d110c.json
@@ -0,0 +1,6 @@
+{
+ "category": "AWS SDK for Java v2",
+ "contributor": "",
+ "type": "feature",
+ "description": "Improve unmarshalling performance of all JSON protocols by unifying parsing with unmarshalling instead of doing one after the other."
+}
diff --git a/codegen/src/main/java/software/amazon/awssdk/codegen/model/config/customization/CustomizationConfig.java b/codegen/src/main/java/software/amazon/awssdk/codegen/model/config/customization/CustomizationConfig.java
index 70289e2a05a7..3cbdd6d83f60 100644
--- a/codegen/src/main/java/software/amazon/awssdk/codegen/model/config/customization/CustomizationConfig.java
+++ b/codegen/src/main/java/software/amazon/awssdk/codegen/model/config/customization/CustomizationConfig.java
@@ -347,6 +347,11 @@ public class CustomizationConfig {
*/
private boolean batchManagerSupported;
+ /**
+ * A boolean flag to indicate if the fast unmarshaller code path is enabled.
+ */
+ private boolean enableFastUnmarshaller;
+
private CustomizationConfig() {
}
@@ -914,4 +919,11 @@ public void setBatchManagerSupported(boolean batchManagerSupported) {
this.batchManagerSupported = batchManagerSupported;
}
+ public boolean getEnableFastUnmarshaller() {
+ return enableFastUnmarshaller;
+ }
+
+ public void setEnableFastUnmarshaller(boolean enableFastUnmarshaller) {
+ this.enableFastUnmarshaller = enableFastUnmarshaller;
+ }
}
diff --git a/codegen/src/main/java/software/amazon/awssdk/codegen/poet/builder/BaseClientBuilderClass.java b/codegen/src/main/java/software/amazon/awssdk/codegen/poet/builder/BaseClientBuilderClass.java
index d98b7556ae98..25269518b7b2 100644
--- a/codegen/src/main/java/software/amazon/awssdk/codegen/poet/builder/BaseClientBuilderClass.java
+++ b/codegen/src/main/java/software/amazon/awssdk/codegen/poet/builder/BaseClientBuilderClass.java
@@ -73,6 +73,7 @@
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.protocols.json.internal.unmarshall.SdkClientJsonProtocolAdvancedOption;
import software.amazon.awssdk.regions.ServiceMetadataAdvancedOption;
import software.amazon.awssdk.utils.AttributeMap;
import software.amazon.awssdk.utils.CollectionUtils;
@@ -479,6 +480,13 @@ private MethodSpec finalizeServiceConfigurationMethod() {
.addCode(" .fipsEnabled(c.get($T.FIPS_ENDPOINT_ENABLED))", AwsClientOption.class)
.addCode(" .build());");
+ if (model.getMetadata().isJsonProtocol()) {
+ if (model.getCustomizationConfig().getEnableFastUnmarshaller()) {
+ builder.addStatement("builder.option($1T.ENABLE_FAST_UNMARSHALLER, true)",
+ SdkClientJsonProtocolAdvancedOption.class);
+ }
+ }
+
builder.addStatement("return builder.build()");
return builder.build();
}
diff --git a/codegen/src/main/java/software/amazon/awssdk/codegen/poet/model/AwsServiceModel.java b/codegen/src/main/java/software/amazon/awssdk/codegen/poet/model/AwsServiceModel.java
index e2fbb81932b7..8168416c26b3 100644
--- a/codegen/src/main/java/software/amazon/awssdk/codegen/poet/model/AwsServiceModel.java
+++ b/codegen/src/main/java/software/amazon/awssdk/codegen/poet/model/AwsServiceModel.java
@@ -38,6 +38,7 @@
import java.util.Collection;
import java.util.Collections;
import java.util.List;
+import java.util.Map;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
@@ -98,7 +99,6 @@ public TypeSpec poetSpec() {
if (shapeModel.isEventStream()) {
return eventStreamInterfaceSpec();
}
-
List fields = shapeModelSpec.fields();
TypeSpec.Builder specBuilder = TypeSpec.classBuilder(className())
@@ -110,9 +110,9 @@ public TypeSpec poetSpec() {
.addFields(fields)
.addFields(shapeModelSpec.staticFields())
.addMethod(addModifier(sdkFieldsMethod(), FINAL))
+ .addMethod(addModifier(sdkFieldNameToFieldMethod(), FINAL))
.addTypes(nestedModelClassTypes());
-
if (shapeModel.isUnion()) {
specBuilder.addField(unionTypeField());
}
@@ -316,6 +316,17 @@ private MethodSpec sdkFieldsMethod() {
.build();
}
+ private MethodSpec sdkFieldNameToFieldMethod() {
+ ParameterizedTypeName sdkFieldType = ParameterizedTypeName.get(ClassName.get(SdkField.class),
+ WildcardTypeName.subtypeOf(ClassName.get(Object.class)));
+ return MethodSpec.methodBuilder("sdkFieldNameToField")
+ .addModifiers(PUBLIC)
+ .addAnnotation(Override.class)
+ .returns(ParameterizedTypeName.get(ClassName.get(Map.class), ClassName.get(String.class), sdkFieldType))
+ .addCode("return SDK_NAME_TO_FIELD;")
+ .build();
+ }
+
private MethodSpec getterCreator() {
TypeVariableName t = TypeVariableName.get("T");
return MethodSpec.methodBuilder("getter")
diff --git a/codegen/src/main/java/software/amazon/awssdk/codegen/poet/model/ModelBuilderSpecs.java b/codegen/src/main/java/software/amazon/awssdk/codegen/poet/model/ModelBuilderSpecs.java
index 0be31c6dd61a..aa61dea0a16a 100644
--- a/codegen/src/main/java/software/amazon/awssdk/codegen/poet/model/ModelBuilderSpecs.java
+++ b/codegen/src/main/java/software/amazon/awssdk/codegen/poet/model/ModelBuilderSpecs.java
@@ -31,6 +31,7 @@
import java.util.ArrayList;
import java.util.EnumSet;
import java.util.List;
+import java.util.Map;
import java.util.Set;
import java.util.function.Consumer;
import javax.lang.model.element.Modifier;
@@ -141,6 +142,7 @@ public TypeSpec beanStyleBuilder() {
builderClassBuilder.addMethods(accessors());
builderClassBuilder.addMethod(buildMethod());
builderClassBuilder.addMethod(sdkFieldsMethod());
+ builderClassBuilder.addMethod(sdkFieldNameToFieldMethod());
if (shapeModel.isUnion()) {
builderClassBuilder.addMethod(handleUnionValueChangeMethod());
@@ -169,6 +171,17 @@ private MethodSpec sdkFieldsMethod() {
.build();
}
+ private MethodSpec sdkFieldNameToFieldMethod() {
+ ParameterizedTypeName sdkFieldType = ParameterizedTypeName.get(ClassName.get(SdkField.class),
+ WildcardTypeName.subtypeOf(ClassName.get(Object.class)));
+ return MethodSpec.methodBuilder("sdkFieldNameToField")
+ .addModifiers(PUBLIC)
+ .addAnnotation(Override.class)
+ .returns(ParameterizedTypeName.get(ClassName.get(Map.class), ClassName.get(String.class), sdkFieldType))
+ .addCode("return SDK_NAME_TO_FIELD;")
+ .build();
+ }
+
private TypeName builderImplSuperClass() {
if (isRequest()) {
return new AwsServiceBaseRequestSpec(intermediateModel).className().nestedClass("BuilderImpl");
diff --git a/codegen/src/main/java/software/amazon/awssdk/codegen/poet/model/ShapeModelSpec.java b/codegen/src/main/java/software/amazon/awssdk/codegen/poet/model/ShapeModelSpec.java
index d10ab65a8a27..531ef2dfff6e 100644
--- a/codegen/src/main/java/software/amazon/awssdk/codegen/poet/model/ShapeModelSpec.java
+++ b/codegen/src/main/java/software/amazon/awssdk/codegen/poet/model/ShapeModelSpec.java
@@ -23,7 +23,10 @@
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
import java.util.List;
+import java.util.Map;
import java.util.Optional;
import java.util.stream.Collectors;
import javax.lang.model.element.Modifier;
@@ -95,6 +98,7 @@ public List fields(Modifier... modifiers) {
public Iterable staticFields(Modifier... modifiers) {
List fields = new ArrayList<>();
+ Map nameToField = new LinkedHashMap<>();
shapeModel.getNonStreamingMembers().stream()
// Exceptions can be members of event stream shapes, need to filter those out of the models
.filter(m -> m.getShape() == null || m.getShape().getShapeType() != ShapeType.Exception)
@@ -107,6 +111,8 @@ public Iterable staticFields(Modifier... modifiers) {
Modifier.PRIVATE, Modifier.STATIC, Modifier.FINAL)
.initializer(sdkFieldInitializer(m))
.build());
+ String name = m.getHttp().getMarshallLocationName();
+ nameToField.put(name, namingStrategy.getSdkFieldFieldName(m));
});
ParameterizedTypeName sdkFieldType = ParameterizedTypeName.get(ClassName.get(SdkField.class),
@@ -115,13 +121,15 @@ public Iterable staticFields(Modifier... modifiers) {
fields.add(FieldSpec.builder(ParameterizedTypeName.get(ClassName.get(List.class),
sdkFieldType), "SDK_FIELDS",
Modifier.PRIVATE, Modifier.STATIC, Modifier.FINAL)
- .initializer("$T.unmodifiableList($T.asList($L))",
- ClassName.get(Collections.class),
- ClassName.get(Arrays.class),
- fields.stream()
- .map(f -> f.name)
- .collect(Collectors.joining(",")))
+ .initializer(sdkFieldsInitializer(fields))
.build());
+ fields.add(FieldSpec.builder(ParameterizedTypeName.get(ClassName.get(Map.class),
+ ClassName.get(String.class),
+ sdkFieldType),
+ "SDK_NAME_TO_FIELD",
+ Modifier.PRIVATE, Modifier.STATIC, Modifier.FINAL)
+ .initializer(memberNameToFieldInitializer(nameToField))
+ .build());
return fields;
}
@@ -369,4 +377,33 @@ private CodeBlock constructor(MemberModel m) {
}
}
+ private CodeBlock sdkFieldsInitializer(List fields) {
+ CodeBlock.Builder builder = CodeBlock.builder();
+ if (fields.isEmpty()) {
+ builder.add("$T.emptyList()", Collections.class);
+ return builder.build();
+ }
+ builder.add("$T.unmodifiableList($T.asList($L))",
+ ClassName.get(Collections.class),
+ ClassName.get(Arrays.class),
+ fields.stream()
+ .map(f -> f.name)
+ .collect(Collectors.joining(",")));
+ return builder.build();
+ }
+
+ private CodeBlock memberNameToFieldInitializer(Map nameToField) {
+ CodeBlock.Builder builder = CodeBlock.builder();
+ if (nameToField.isEmpty()) {
+ builder.add("$T.emptyMap()", Collections.class);
+ return builder.build();
+ }
+ builder.add("$T.unmodifiableMap(", Collections.class);
+ builder.add("new $T<$T, $T>>() {{\n", HashMap.class, String.class, SdkField.class);
+ nameToField.forEach((name, field) -> builder.add("put($S, $L);\n", name, field));
+ builder.add("}}");
+ builder.add(")");
+ return builder.build();
+ }
+
}
diff --git a/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/alltypesrequest.java b/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/alltypesrequest.java
index 72788016688a..643a7d6bb765 100644
--- a/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/alltypesrequest.java
+++ b/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/alltypesrequest.java
@@ -5,6 +5,7 @@
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
+import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
@@ -450,6 +451,48 @@ SdkField. builder(MarshallingType.SDK_BYTES)
POLYMORPHIC_TYPE_WITHOUT_SUB_TYPES_FIELD, ENUM_TYPE_FIELD, UNDERSCORE_NAME_TYPE_FIELD, MY_DOCUMENT_FIELD,
ALL_TYPES_UNION_STRUCTURE_FIELD));
+ private static final Map> SDK_NAME_TO_FIELD = Collections
+ .unmodifiableMap(new HashMap>() {
+ {
+ put("StringMember", STRING_MEMBER_FIELD);
+ put("IntegerMember", INTEGER_MEMBER_FIELD);
+ put("BooleanMember", BOOLEAN_MEMBER_FIELD);
+ put("FloatMember", FLOAT_MEMBER_FIELD);
+ put("DoubleMember", DOUBLE_MEMBER_FIELD);
+ put("LongMember", LONG_MEMBER_FIELD);
+ put("ShortMember", SHORT_MEMBER_FIELD);
+ put("ByteMember", BYTE_MEMBER_FIELD);
+ put("SimpleList", SIMPLE_LIST_FIELD);
+ put("ListOfEnums", LIST_OF_ENUMS_FIELD);
+ put("ListOfMaps", LIST_OF_MAPS_FIELD);
+ put("ListOfStructs", LIST_OF_STRUCTS_FIELD);
+ put("ListOfMapOfEnumToString", LIST_OF_MAP_OF_ENUM_TO_STRING_FIELD);
+ put("ListOfMapOfStringToStruct", LIST_OF_MAP_OF_STRING_TO_STRUCT_FIELD);
+ put("MapOfStringToIntegerList", MAP_OF_STRING_TO_INTEGER_LIST_FIELD);
+ put("MapOfStringToString", MAP_OF_STRING_TO_STRING_FIELD);
+ put("MapOfStringToSimpleStruct", MAP_OF_STRING_TO_SIMPLE_STRUCT_FIELD);
+ put("MapOfEnumToEnum", MAP_OF_ENUM_TO_ENUM_FIELD);
+ put("MapOfEnumToString", MAP_OF_ENUM_TO_STRING_FIELD);
+ put("MapOfStringToEnum", MAP_OF_STRING_TO_ENUM_FIELD);
+ put("MapOfEnumToSimpleStruct", MAP_OF_ENUM_TO_SIMPLE_STRUCT_FIELD);
+ put("MapOfEnumToListOfEnums", MAP_OF_ENUM_TO_LIST_OF_ENUMS_FIELD);
+ put("MapOfEnumToMapOfStringToEnum", MAP_OF_ENUM_TO_MAP_OF_STRING_TO_ENUM_FIELD);
+ put("TimestampMember", TIMESTAMP_MEMBER_FIELD);
+ put("StructWithNestedTimestampMember", STRUCT_WITH_NESTED_TIMESTAMP_MEMBER_FIELD);
+ put("BlobArg", BLOB_ARG_FIELD);
+ put("StructWithNestedBlob", STRUCT_WITH_NESTED_BLOB_FIELD);
+ put("BlobMap", BLOB_MAP_FIELD);
+ put("ListOfBlobs", LIST_OF_BLOBS_FIELD);
+ put("RecursiveStruct", RECURSIVE_STRUCT_FIELD);
+ put("PolymorphicTypeWithSubTypes", POLYMORPHIC_TYPE_WITH_SUB_TYPES_FIELD);
+ put("PolymorphicTypeWithoutSubTypes", POLYMORPHIC_TYPE_WITHOUT_SUB_TYPES_FIELD);
+ put("EnumType", ENUM_TYPE_FIELD);
+ put("Underscore_Name_Type", UNDERSCORE_NAME_TYPE_FIELD);
+ put("MyDocument", MY_DOCUMENT_FIELD);
+ put("AllTypesUnionStructure", ALL_TYPES_UNION_STRUCTURE_FIELD);
+ }
+ });
+
private final String stringMember;
private final Integer integerMember;
@@ -1604,6 +1647,11 @@ public final List> sdkFields() {
return SDK_FIELDS;
}
+ @Override
+ public final Map> sdkFieldNameToField() {
+ return SDK_NAME_TO_FIELD;
+ }
+
private static Function getter(Function g) {
return obj -> g.apply((AllTypesRequest) obj);
}
@@ -3065,5 +3113,10 @@ public AllTypesRequest build() {
public List> sdkFields() {
return SDK_FIELDS;
}
+
+ @Override
+ public Map> sdkFieldNameToField() {
+ return SDK_NAME_TO_FIELD;
+ }
}
}
diff --git a/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/alltypesresponse.java b/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/alltypesresponse.java
index 27335cef0cec..80b06d4e8305 100644
--- a/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/alltypesresponse.java
+++ b/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/alltypesresponse.java
@@ -5,6 +5,7 @@
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
+import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
@@ -449,6 +450,48 @@ SdkField. builder(MarshallingType.SDK_BYTES)
POLYMORPHIC_TYPE_WITHOUT_SUB_TYPES_FIELD, ENUM_TYPE_FIELD, UNDERSCORE_NAME_TYPE_FIELD, MY_DOCUMENT_FIELD,
ALL_TYPES_UNION_STRUCTURE_FIELD));
+ private static final Map> SDK_NAME_TO_FIELD = Collections
+ .unmodifiableMap(new HashMap>() {
+ {
+ put("StringMember", STRING_MEMBER_FIELD);
+ put("IntegerMember", INTEGER_MEMBER_FIELD);
+ put("BooleanMember", BOOLEAN_MEMBER_FIELD);
+ put("FloatMember", FLOAT_MEMBER_FIELD);
+ put("DoubleMember", DOUBLE_MEMBER_FIELD);
+ put("LongMember", LONG_MEMBER_FIELD);
+ put("ShortMember", SHORT_MEMBER_FIELD);
+ put("ByteMember", BYTE_MEMBER_FIELD);
+ put("SimpleList", SIMPLE_LIST_FIELD);
+ put("ListOfEnums", LIST_OF_ENUMS_FIELD);
+ put("ListOfMaps", LIST_OF_MAPS_FIELD);
+ put("ListOfStructs", LIST_OF_STRUCTS_FIELD);
+ put("ListOfMapOfEnumToString", LIST_OF_MAP_OF_ENUM_TO_STRING_FIELD);
+ put("ListOfMapOfStringToStruct", LIST_OF_MAP_OF_STRING_TO_STRUCT_FIELD);
+ put("MapOfStringToIntegerList", MAP_OF_STRING_TO_INTEGER_LIST_FIELD);
+ put("MapOfStringToString", MAP_OF_STRING_TO_STRING_FIELD);
+ put("MapOfStringToSimpleStruct", MAP_OF_STRING_TO_SIMPLE_STRUCT_FIELD);
+ put("MapOfEnumToEnum", MAP_OF_ENUM_TO_ENUM_FIELD);
+ put("MapOfEnumToString", MAP_OF_ENUM_TO_STRING_FIELD);
+ put("MapOfStringToEnum", MAP_OF_STRING_TO_ENUM_FIELD);
+ put("MapOfEnumToSimpleStruct", MAP_OF_ENUM_TO_SIMPLE_STRUCT_FIELD);
+ put("MapOfEnumToListOfEnums", MAP_OF_ENUM_TO_LIST_OF_ENUMS_FIELD);
+ put("MapOfEnumToMapOfStringToEnum", MAP_OF_ENUM_TO_MAP_OF_STRING_TO_ENUM_FIELD);
+ put("TimestampMember", TIMESTAMP_MEMBER_FIELD);
+ put("StructWithNestedTimestampMember", STRUCT_WITH_NESTED_TIMESTAMP_MEMBER_FIELD);
+ put("BlobArg", BLOB_ARG_FIELD);
+ put("StructWithNestedBlob", STRUCT_WITH_NESTED_BLOB_FIELD);
+ put("BlobMap", BLOB_MAP_FIELD);
+ put("ListOfBlobs", LIST_OF_BLOBS_FIELD);
+ put("RecursiveStruct", RECURSIVE_STRUCT_FIELD);
+ put("PolymorphicTypeWithSubTypes", POLYMORPHIC_TYPE_WITH_SUB_TYPES_FIELD);
+ put("PolymorphicTypeWithoutSubTypes", POLYMORPHIC_TYPE_WITHOUT_SUB_TYPES_FIELD);
+ put("EnumType", ENUM_TYPE_FIELD);
+ put("Underscore_Name_Type", UNDERSCORE_NAME_TYPE_FIELD);
+ put("MyDocument", MY_DOCUMENT_FIELD);
+ put("AllTypesUnionStructure", ALL_TYPES_UNION_STRUCTURE_FIELD);
+ }
+ });
+
private final String stringMember;
private final Integer integerMember;
@@ -1603,6 +1646,11 @@ public final List> sdkFields() {
return SDK_FIELDS;
}
+ @Override
+ public final Map> sdkFieldNameToField() {
+ return SDK_NAME_TO_FIELD;
+ }
+
private static Function getter(Function g) {
return obj -> g.apply((AllTypesResponse) obj);
}
@@ -3046,5 +3094,10 @@ public AllTypesResponse build() {
public List> sdkFields() {
return SDK_FIELDS;
}
+
+ @Override
+ public Map> sdkFieldNameToField() {
+ return SDK_NAME_TO_FIELD;
+ }
}
}
diff --git a/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/alltypesunionstructure.java b/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/alltypesunionstructure.java
index c06e64940b14..c4d8daf656b7 100644
--- a/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/alltypesunionstructure.java
+++ b/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/alltypesunionstructure.java
@@ -7,6 +7,7 @@
import java.util.Collection;
import java.util.Collections;
import java.util.EnumSet;
+import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
@@ -39,418 +40,459 @@
*/
@Generated("software.amazon.awssdk:codegen")
public final class AllTypesUnionStructure implements SdkPojo, Serializable,
- ToCopyableBuilder {
+ ToCopyableBuilder {
private static final SdkField STRING_MEMBER_FIELD = SdkField. builder(MarshallingType.STRING)
- .memberName("StringMember").getter(getter(AllTypesUnionStructure::stringMember))
- .setter(setter(Builder::stringMember))
- .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StringMember").build()).build();
+ .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_MEMBER_FIELD = SdkField. builder(MarshallingType.INTEGER)
- .memberName("IntegerMember").getter(getter(AllTypesUnionStructure::integerMember))
- .setter(setter(Builder::integerMember))
- .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("IntegerMember").build()).build();
+ .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_MEMBER_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
- .memberName("BooleanMember").getter(getter(AllTypesUnionStructure::booleanMember))
- .setter(setter(Builder::booleanMember))
- .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("BooleanMember").build()).build();
+ .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_MEMBER_FIELD = SdkField. builder(MarshallingType.FLOAT)
- .memberName("FloatMember").getter(getter(AllTypesUnionStructure::floatMember)).setter(setter(Builder::floatMember))
- .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("FloatMember").build()).build();
+ .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_MEMBER_FIELD = SdkField. builder(MarshallingType.DOUBLE)
- .memberName("DoubleMember").getter(getter(AllTypesUnionStructure::doubleMember))
- .setter(setter(Builder::doubleMember))
- .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DoubleMember").build()).build();
+ .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_MEMBER_FIELD = SdkField. builder(MarshallingType.LONG)
- .memberName("LongMember").getter(getter(AllTypesUnionStructure::longMember)).setter(setter(Builder::longMember))
- .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LongMember").build()).build();
+ .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_MEMBER_FIELD = SdkField. builder(MarshallingType.SHORT)
- .memberName("ShortMember").getter(getter(AllTypesUnionStructure::shortMember)).setter(setter(Builder::shortMember))
- .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ShortMember").build()).build();
+ .memberName("ShortMember").getter(getter(AllTypesUnionStructure::shortMember)).setter(setter(Builder::shortMember))
+ .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ShortMember").build()).build();
private static final SdkField> SIMPLE_LIST_FIELD = SdkField
- .> 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. builder(MarshallingType.STRING)
- .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
- .locationName("member").build()).build()).build()).build();
+ .> 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. builder(MarshallingType.STRING)
+ .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
+ .locationName("member").build()).build()).build()).build();
private static final SdkField> LIST_OF_ENUMS_FIELD = SdkField
- .> 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. builder(MarshallingType.STRING)
- .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
- .locationName("member").build()).build()).build()).build();
+ .> 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. builder(MarshallingType.STRING)
+ .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
+ .locationName("member").build()).build()).build()).build();
private static final SdkField>> LIST_OF_MAPS_FIELD = SdkField
- .>> 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.> builder(MarshallingType.MAP)
- .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
- .locationName("member").build(),
- MapTrait.builder()
- .keyLocationName("key")
- .valueLocationName("value")
- .valueFieldInfo(
- SdkField. builder(MarshallingType.STRING)
- .traits(LocationTrait.builder()
- .location(MarshallLocation.PAYLOAD)
- .locationName("value").build()).build())
- .build()).build()).build()).build();
+ .>> 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.> builder(MarshallingType.MAP)
+ .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
+ .locationName("member").build(),
+ MapTrait.builder()
+ .keyLocationName("key")
+ .valueLocationName("value")
+ .valueFieldInfo(
+ SdkField. builder(MarshallingType.STRING)
+ .traits(LocationTrait.builder()
+ .location(MarshallLocation.PAYLOAD)
+ .locationName("value").build()).build())
+ .build()).build()).build()).build();
private static final SdkField> LIST_OF_STRUCTS_FIELD = SdkField
- .> 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. builder(MarshallingType.SDK_POJO)
- .constructor(SimpleStruct::builder)
- .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
- .locationName("member").build()).build()).build()).build();
+ .> 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. builder(MarshallingType.SDK_POJO)
+ .constructor(SimpleStruct::builder)
+ .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
+ .locationName("member").build()).build()).build()).build();
private static final SdkField>> LIST_OF_MAP_OF_ENUM_TO_STRING_FIELD = SdkField
- .>> 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.> builder(MarshallingType.MAP)
- .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
- .locationName("member").build(),
- MapTrait.builder()
- .keyLocationName("key")
- .valueLocationName("value")
- .valueFieldInfo(
- SdkField. builder(MarshallingType.STRING)
- .traits(LocationTrait.builder()
- .location(MarshallLocation.PAYLOAD)
- .locationName("value").build()).build())
- .build()).build()).build()).build();
+ .>> 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.> builder(MarshallingType.MAP)
+ .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
+ .locationName("member").build(),
+ MapTrait.builder()
+ .keyLocationName("key")
+ .valueLocationName("value")
+ .valueFieldInfo(
+ SdkField. builder(MarshallingType.STRING)
+ .traits(LocationTrait.builder()
+ .location(MarshallLocation.PAYLOAD)
+ .locationName("value").build()).build())
+ .build()).build()).build()).build();
private static final SdkField>> LIST_OF_MAP_OF_STRING_TO_STRUCT_FIELD = SdkField
- .>> 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.> builder(MarshallingType.MAP)
- .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
- .locationName("member").build(),
- MapTrait.builder()
- .keyLocationName("key")
- .valueLocationName("value")
- .valueFieldInfo(
- SdkField. builder(MarshallingType.SDK_POJO)
- .constructor(SimpleStruct::builder)
- .traits(LocationTrait.builder()
- .location(MarshallLocation.PAYLOAD)
- .locationName("value").build()).build())
- .build()).build()).build()).build();
+ .>> 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.> builder(MarshallingType.MAP)
+ .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
+ .locationName("member").build(),
+ MapTrait.builder()
+ .keyLocationName("key")
+ .valueLocationName("value")
+ .valueFieldInfo(
+ SdkField. 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_OF_STRING_TO_INTEGER_LIST_FIELD = SdkField
- .>> 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.> builder(MarshallingType.LIST)
- .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
- .locationName("value").build(),
- ListTrait
- .builder()
- .memberLocationName(null)
- .memberFieldInfo(
- SdkField. builder(MarshallingType.INTEGER)
- .traits(LocationTrait.builder()
- .location(MarshallLocation.PAYLOAD)
- .locationName("member").build()).build())
- .build()).build()).build()).build();
+ .>> 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.> builder(MarshallingType.LIST)
+ .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
+ .locationName("value").build(),
+ ListTrait
+ .builder()
+ .memberLocationName(null)
+ .memberFieldInfo(
+ SdkField. builder(MarshallingType.INTEGER)
+ .traits(LocationTrait.builder()
+ .location(MarshallLocation.PAYLOAD)
+ .locationName("member").build()).build())
+ .build()).build()).build()).build();
private static final SdkField> MAP_OF_STRING_TO_STRING_FIELD = SdkField
- .> 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. builder(MarshallingType.STRING)
- .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
- .locationName("value").build()).build()).build()).build();
+ .> 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. builder(MarshallingType.STRING)
+ .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
+ .locationName("value").build()).build()).build()).build();
private static final SdkField> MAP_OF_STRING_TO_SIMPLE_STRUCT_FIELD = SdkField
- .> 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. builder(MarshallingType.SDK_POJO)
- .constructor(SimpleStruct::builder)
- .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
- .locationName("value").build()).build()).build()).build();
+ .> 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. builder(MarshallingType.SDK_POJO)
+ .constructor(SimpleStruct::builder)
+ .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
+ .locationName("value").build()).build()).build()).build();
private static final SdkField> MAP_OF_ENUM_TO_ENUM_FIELD = SdkField
- .> 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. builder(MarshallingType.STRING)
- .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
- .locationName("value").build()).build()).build()).build();
+ .> 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. builder(MarshallingType.STRING)
+ .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
+ .locationName("value").build()).build()).build()).build();
private static final SdkField> MAP_OF_ENUM_TO_STRING_FIELD = SdkField
- .> 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. builder(MarshallingType.STRING)
- .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
- .locationName("value").build()).build()).build()).build();
+ .> 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. builder(MarshallingType.STRING)
+ .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
+ .locationName("value").build()).build()).build()).build();
private static final SdkField> MAP_OF_STRING_TO_ENUM_FIELD = SdkField
- .> 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. builder(MarshallingType.STRING)
- .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
- .locationName("value").build()).build()).build()).build();
+ .> 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. builder(MarshallingType.STRING)
+ .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
+ .locationName("value").build()).build()).build()).build();
private static final SdkField> MAP_OF_ENUM_TO_SIMPLE_STRUCT_FIELD = SdkField
- .> 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. builder(MarshallingType.SDK_POJO)
- .constructor(SimpleStruct::builder)
- .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
- .locationName("value").build()).build()).build()).build();
+ .> 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. builder(MarshallingType.SDK_POJO)
+ .constructor(SimpleStruct::builder)
+ .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
+ .locationName("value").build()).build()).build()).build();
private static final SdkField>> MAP_OF_ENUM_TO_LIST_OF_ENUMS_FIELD = SdkField
- .>> 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.> builder(MarshallingType.LIST)
- .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
- .locationName("value").build(),
- ListTrait
- .builder()
- .memberLocationName(null)
- .memberFieldInfo(
- SdkField. builder(MarshallingType.STRING)
- .traits(LocationTrait.builder()
- .location(MarshallLocation.PAYLOAD)
- .locationName("member").build()).build())
- .build()).build()).build()).build();
+ .>> 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.> builder(MarshallingType.LIST)
+ .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
+ .locationName("value").build(),
+ ListTrait
+ .builder()
+ .memberLocationName(null)
+ .memberFieldInfo(
+ SdkField. builder(MarshallingType.STRING)
+ .traits(LocationTrait.builder()
+ .location(MarshallLocation.PAYLOAD)
+ .locationName("member").build()).build())
+ .build()).build()).build()).build();
private static final SdkField>> MAP_OF_ENUM_TO_MAP_OF_STRING_TO_ENUM_FIELD = SdkField
- .>> 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.> builder(MarshallingType.MAP)
- .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
- .locationName("value").build(),
- MapTrait.builder()
- .keyLocationName("key")
- .valueLocationName("value")
- .valueFieldInfo(
- SdkField. builder(MarshallingType.STRING)
- .traits(LocationTrait.builder()
- .location(MarshallLocation.PAYLOAD)
- .locationName("value").build()).build())
- .build()).build()).build()).build();
+ .>> 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.> builder(MarshallingType.MAP)
+ .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
+ .locationName("value").build(),
+ MapTrait.builder()
+ .keyLocationName("key")
+ .valueLocationName("value")
+ .valueFieldInfo(
+ SdkField. builder(MarshallingType.STRING)
+ .traits(LocationTrait.builder()
+ .location(MarshallLocation.PAYLOAD)
+ .locationName("value").build()).build())
+ .build()).build()).build()).build();
private static final SdkField TIMESTAMP_MEMBER_FIELD = SdkField. builder(MarshallingType.INSTANT)
- .memberName("TimestampMember").getter(getter(AllTypesUnionStructure::timestampMember))
- .setter(setter(Builder::timestampMember))
- .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TimestampMember").build()).build();
+ .memberName("TimestampMember").getter(getter(AllTypesUnionStructure::timestampMember))
+ .setter(setter(Builder::timestampMember))
+ .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TimestampMember").build()).build();
private static final SdkField STRUCT_WITH_NESTED_TIMESTAMP_MEMBER_FIELD = SdkField
- . 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();
+ . 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 BLOB_ARG_FIELD = SdkField. builder(MarshallingType.SDK_BYTES)
- .memberName("BlobArg").getter(getter(AllTypesUnionStructure::blobArg)).setter(setter(Builder::blobArg))
- .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("BlobArg").build()).build();
+ .memberName("BlobArg").getter(getter(AllTypesUnionStructure::blobArg)).setter(setter(Builder::blobArg))
+ .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("BlobArg").build()).build();
private static final SdkField STRUCT_WITH_NESTED_BLOB_FIELD = SdkField
- . 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();
+ . 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> BLOB_MAP_FIELD = SdkField
- .> 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. builder(MarshallingType.SDK_BYTES)
- .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
- .locationName("value").build()).build()).build()).build();
+ .> 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. builder(MarshallingType.SDK_BYTES)
+ .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
+ .locationName("value").build()).build()).build()).build();
private static final SdkField> LIST_OF_BLOBS_FIELD = SdkField
- .> 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. builder(MarshallingType.SDK_BYTES)
- .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
- .locationName("member").build()).build()).build()).build();
+ .> 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. builder(MarshallingType.SDK_BYTES)
+ .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
+ .locationName("member").build()).build()).build()).build();
private static final SdkField RECURSIVE_STRUCT_FIELD = SdkField
- . 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();
+ . 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 POLYMORPHIC_TYPE_WITH_SUB_TYPES_FIELD = SdkField
- . 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();
+ . 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 POLYMORPHIC_TYPE_WITHOUT_SUB_TYPES_FIELD = SdkField
- . 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();
+ . 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 ENUM_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
- .memberName("EnumType").getter(getter(AllTypesUnionStructure::enumTypeAsString)).setter(setter(Builder::enumType))
- .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EnumType").build()).build();
+ .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_FIELD = SdkField
- . 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();
+ . 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 MY_DOCUMENT_FIELD = SdkField. builder(MarshallingType.DOCUMENT)
- .memberName("MyDocument").getter(getter(AllTypesUnionStructure::myDocument)).setter(setter(Builder::myDocument))
- .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MyDocument").build()).build();
+ .memberName("MyDocument").getter(getter(AllTypesUnionStructure::myDocument)).setter(setter(Builder::myDocument))
+ .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MyDocument").build()).build();
private static final SdkField ALL_TYPES_UNION_STRUCTURE_FIELD = SdkField
- . 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();
+ . 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> 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));
+ 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 Map> SDK_NAME_TO_FIELD = Collections
+ .unmodifiableMap(new HashMap>() {
+ {
+ put("StringMember", STRING_MEMBER_FIELD);
+ put("IntegerMember", INTEGER_MEMBER_FIELD);
+ put("BooleanMember", BOOLEAN_MEMBER_FIELD);
+ put("FloatMember", FLOAT_MEMBER_FIELD);
+ put("DoubleMember", DOUBLE_MEMBER_FIELD);
+ put("LongMember", LONG_MEMBER_FIELD);
+ put("ShortMember", SHORT_MEMBER_FIELD);
+ put("SimpleList", SIMPLE_LIST_FIELD);
+ put("ListOfEnums", LIST_OF_ENUMS_FIELD);
+ put("ListOfMaps", LIST_OF_MAPS_FIELD);
+ put("ListOfStructs", LIST_OF_STRUCTS_FIELD);
+ put("ListOfMapOfEnumToString", LIST_OF_MAP_OF_ENUM_TO_STRING_FIELD);
+ put("ListOfMapOfStringToStruct", LIST_OF_MAP_OF_STRING_TO_STRUCT_FIELD);
+ put("MapOfStringToIntegerList", MAP_OF_STRING_TO_INTEGER_LIST_FIELD);
+ put("MapOfStringToString", MAP_OF_STRING_TO_STRING_FIELD);
+ put("MapOfStringToSimpleStruct", MAP_OF_STRING_TO_SIMPLE_STRUCT_FIELD);
+ put("MapOfEnumToEnum", MAP_OF_ENUM_TO_ENUM_FIELD);
+ put("MapOfEnumToString", MAP_OF_ENUM_TO_STRING_FIELD);
+ put("MapOfStringToEnum", MAP_OF_STRING_TO_ENUM_FIELD);
+ put("MapOfEnumToSimpleStruct", MAP_OF_ENUM_TO_SIMPLE_STRUCT_FIELD);
+ put("MapOfEnumToListOfEnums", MAP_OF_ENUM_TO_LIST_OF_ENUMS_FIELD);
+ put("MapOfEnumToMapOfStringToEnum", MAP_OF_ENUM_TO_MAP_OF_STRING_TO_ENUM_FIELD);
+ put("TimestampMember", TIMESTAMP_MEMBER_FIELD);
+ put("StructWithNestedTimestampMember", STRUCT_WITH_NESTED_TIMESTAMP_MEMBER_FIELD);
+ put("BlobArg", BLOB_ARG_FIELD);
+ put("StructWithNestedBlob", STRUCT_WITH_NESTED_BLOB_FIELD);
+ put("BlobMap", BLOB_MAP_FIELD);
+ put("ListOfBlobs", LIST_OF_BLOBS_FIELD);
+ put("RecursiveStruct", RECURSIVE_STRUCT_FIELD);
+ put("PolymorphicTypeWithSubTypes", POLYMORPHIC_TYPE_WITH_SUB_TYPES_FIELD);
+ put("PolymorphicTypeWithoutSubTypes", POLYMORPHIC_TYPE_WITHOUT_SUB_TYPES_FIELD);
+ put("EnumType", ENUM_TYPE_FIELD);
+ put("Underscore_Name_Type", UNDERSCORE_NAME_TYPE_FIELD);
+ put("MyDocument", MY_DOCUMENT_FIELD);
+ put("AllTypesUnionStructure", ALL_TYPES_UNION_STRUCTURE_FIELD);
+ }
+ });
private static final long serialVersionUID = 1L;
@@ -567,7 +609,7 @@ private AllTypesUnionStructure(BuilderImpl builder) {
/**
* Returns the value of the StringMember property for this object.
- *
+ *
* @return The value of the StringMember property for this object.
*/
public final String stringMember() {
@@ -576,7 +618,7 @@ public final String 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() {
@@ -585,7 +627,7 @@ public final Integer 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() {
@@ -594,7 +636,7 @@ public final Boolean 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() {
@@ -603,7 +645,7 @@ public final Float 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() {
@@ -612,7 +654,7 @@ public final Double 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() {
@@ -621,7 +663,7 @@ public final Long 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() {
@@ -649,7 +691,7 @@ public final boolean hasSimpleList() {
* 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.
*
- *
+ *
* @return The value of the SimpleList property for this object.
*/
public final List simpleList() {
@@ -665,7 +707,7 @@ public final List simpleList() {
* 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.
*
- *
+ *
* @return The value of the ListOfEnums property for this object.
*/
public final List listOfEnums() {
@@ -693,7 +735,7 @@ public final boolean hasListOfEnums() {
* 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.
*
- *
+ *
* @return The value of the ListOfEnums property for this object.
*/
public final List listOfEnumsAsStrings() {
@@ -721,7 +763,7 @@ public final boolean hasListOfMaps() {
* 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.
*
- *
+ *
* @return The value of the ListOfMaps property for this object.
*/
public final List> listOfMaps() {
@@ -749,7 +791,7 @@ public final boolean hasListOfStructs() {
* 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.
*
- *
+ *
* @return The value of the ListOfStructs property for this object.
*/
public final List listOfStructs() {
@@ -765,7 +807,7 @@ public final List listOfStructs() {
* 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.
*
- *
+ *
* @return The value of the ListOfMapOfEnumToString property for this object.
*/
public final List> listOfMapOfEnumToString() {
@@ -793,7 +835,7 @@ public final boolean hasListOfMapOfEnumToString() {
* 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.
*
- *
+ *
* @return The value of the ListOfMapOfEnumToString property for this object.
*/
public final List> listOfMapOfEnumToStringAsStrings() {
@@ -821,7 +863,7 @@ public final boolean hasListOfMapOfStringToStruct() {
* 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.
*
- *
+ *
* @return The value of the ListOfMapOfStringToStruct property for this object.
*/
public final List> listOfMapOfStringToStruct() {
@@ -849,7 +891,7 @@ public final boolean hasMapOfStringToIntegerList() {
* 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.
*
- *
+ *
* @return The value of the MapOfStringToIntegerList property for this object.
*/
public final Map> mapOfStringToIntegerList() {
@@ -877,7 +919,7 @@ public final boolean hasMapOfStringToString() {
* 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.
*
- *
+ *
* @return The value of the MapOfStringToString property for this object.
*/
public final Map mapOfStringToString() {
@@ -905,7 +947,7 @@ public final boolean hasMapOfStringToSimpleStruct() {
* 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.
*
- *
+ *
* @return The value of the MapOfStringToSimpleStruct property for this object.
*/
public final Map mapOfStringToSimpleStruct() {
@@ -921,7 +963,7 @@ public final Map mapOfStringToSimpleStruct() {
* 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.
*
- *
+ *
* @return The value of the MapOfEnumToEnum property for this object.
*/
public final Map mapOfEnumToEnum() {
@@ -949,7 +991,7 @@ public final boolean hasMapOfEnumToEnum() {
* 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.
*
- *
+ *
* @return The value of the MapOfEnumToEnum property for this object.
*/
public final Map mapOfEnumToEnumAsStrings() {
@@ -965,7 +1007,7 @@ public final Map mapOfEnumToEnumAsStrings() {
* 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.
*
- *
+ *
* @return The value of the MapOfEnumToString property for this object.
*/
public final Map mapOfEnumToString() {
@@ -993,7 +1035,7 @@ public final boolean hasMapOfEnumToString() {
* 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.
*
- *
+ *
* @return The value of the MapOfEnumToString property for this object.
*/
public final Map mapOfEnumToStringAsStrings() {
@@ -1009,7 +1051,7 @@ public final Map mapOfEnumToStringAsStrings() {
* 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.
*
- *
+ *
* @return The value of the MapOfStringToEnum property for this object.
*/
public final Map mapOfStringToEnum() {
@@ -1037,7 +1079,7 @@ public final boolean hasMapOfStringToEnum() {
* 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.
*
- *
+ *
* @return The value of the MapOfStringToEnum property for this object.
*/
public final Map mapOfStringToEnumAsStrings() {
@@ -1053,7 +1095,7 @@ public final Map mapOfStringToEnumAsStrings() {
* 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.
*
- *
+ *
* @return The value of the MapOfEnumToSimpleStruct property for this object.
*/
public final Map mapOfEnumToSimpleStruct() {
@@ -1081,7 +1123,7 @@ public final boolean hasMapOfEnumToSimpleStruct() {
* 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.
*
- *
+ *
* @return The value of the MapOfEnumToSimpleStruct property for this object.
*/
public final Map mapOfEnumToSimpleStructAsStrings() {
@@ -1097,7 +1139,7 @@ public final Map mapOfEnumToSimpleStructAsStrings() {
* 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.
*
- *
+ *
* @return The value of the MapOfEnumToListOfEnums property for this object.
*/
public final Map> mapOfEnumToListOfEnums() {
@@ -1125,7 +1167,7 @@ public final boolean hasMapOfEnumToListOfEnums() {
* 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.
*
- *
+ *
* @return The value of the MapOfEnumToListOfEnums property for this object.
*/
public final Map> mapOfEnumToListOfEnumsAsStrings() {
@@ -1141,7 +1183,7 @@ public final Map> mapOfEnumToListOfEnumsAsStrings() {
* 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.
*
- *
+ *
* @return The value of the MapOfEnumToMapOfStringToEnum property for this object.
*/
public final Map> mapOfEnumToMapOfStringToEnum() {
@@ -1169,7 +1211,7 @@ public final boolean hasMapOfEnumToMapOfStringToEnum() {
* 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.
*
- *
+ *
* @return The value of the MapOfEnumToMapOfStringToEnum property for this object.
*/
public final Map> mapOfEnumToMapOfStringToEnumAsStrings() {
@@ -1178,7 +1220,7 @@ public final Map> mapOfEnumToMapOfStringToEnumAsStri
/**
* Returns the value of the TimestampMember property for this object.
- *
+ *
* @return The value of the TimestampMember property for this object.
*/
public final Instant timestampMember() {
@@ -1187,7 +1229,7 @@ public final Instant 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() {
@@ -1196,7 +1238,7 @@ public final StructWithTimestamp 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() {
@@ -1205,7 +1247,7 @@ public final SdkBytes 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() {
@@ -1233,7 +1275,7 @@ public final boolean hasBlobMap() {
* 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.
*
- *
+ *
* @return The value of the BlobMap property for this object.
*/
public final Map blobMap() {
@@ -1261,7 +1303,7 @@ public final boolean hasListOfBlobs() {
* 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.
*
- *
+ *
* @return The value of the ListOfBlobs property for this object.
*/
public final List listOfBlobs() {
@@ -1270,7 +1312,7 @@ public final List 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() {
@@ -1279,7 +1321,7 @@ public final RecursiveStructType 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() {
@@ -1288,7 +1330,7 @@ public final BaseType 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() {
@@ -1302,7 +1344,7 @@ public final SubTypeOne polymorphicTypeWithoutSubTypes() {
* return {@link EnumType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #enumTypeAsString}.
*
- *
+ *
* @return The value of the EnumType property for this object.
* @see EnumType
*/
@@ -1317,7 +1359,7 @@ public final EnumType enumType() {
* return {@link EnumType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #enumTypeAsString}.
*
- *
+ *
* @return The value of the EnumType property for this object.
* @see EnumType
*/
@@ -1327,7 +1369,7 @@ public final String enumTypeAsString() {
/**
* 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() {
@@ -1336,7 +1378,7 @@ public final Underscore_Name_Type 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() {
@@ -1345,7 +1387,7 @@ public final Document 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() {
@@ -1390,7 +1432,7 @@ public final int hashCode() {
hashCode = 31 * hashCode + Objects.hashCode(hasMapOfEnumToSimpleStruct() ? mapOfEnumToSimpleStructAsStrings() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasMapOfEnumToListOfEnums() ? mapOfEnumToListOfEnumsAsStrings() : null);
hashCode = 31 * hashCode
- + Objects.hashCode(hasMapOfEnumToMapOfStringToEnum() ? mapOfEnumToMapOfStringToEnumAsStrings() : null);
+ + Objects.hashCode(hasMapOfEnumToMapOfStringToEnum() ? mapOfEnumToMapOfStringToEnumAsStrings() : null);
hashCode = 31 * hashCode + Objects.hashCode(timestampMember());
hashCode = 31 * hashCode + Objects.hashCode(structWithNestedTimestampMember());
hashCode = 31 * hashCode + Objects.hashCode(blobArg());
@@ -1425,48 +1467,48 @@ public final boolean equalsBySdkFields(Object obj) {
}
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());
+ && 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());
}
/**
@@ -1476,114 +1518,114 @@ && hasMapOfEnumToMapOfStringToEnum() == other.hasMapOfEnumToMapOfStringToEnum()
@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();
+ .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 Optional getValueForField(String fieldName, Class 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();
+ 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();
}
}
@@ -1740,7 +1782,7 @@ public static AllTypesUnionStructure fromListOfStructs(List listOf
* The new value for the ListOfMapOfEnumToString property for this object.
*/
public static AllTypesUnionStructure fromListOfMapOfEnumToStringWithStrings(
- List> listOfMapOfEnumToStringWithStrings) {
+ List> listOfMapOfEnumToStringWithStrings) {
return builder().listOfMapOfEnumToStringWithStrings(listOfMapOfEnumToStringWithStrings).build();
}
@@ -1753,7 +1795,7 @@ public static AllTypesUnionStructure fromListOfMapOfEnumToStringWithStrings(
* The new value for the ListOfMapOfEnumToString property for this object.
*/
public static AllTypesUnionStructure fromListOfMapOfEnumToString(
- List> listOfMapOfEnumToStringWithStrings) {
+ List> listOfMapOfEnumToStringWithStrings) {
return builder().listOfMapOfEnumToString(listOfMapOfEnumToStringWithStrings).build();
}
@@ -1886,7 +1928,7 @@ public static AllTypesUnionStructure fromMapOfStringToEnum(Map
* The new value for the MapOfEnumToSimpleStruct property for this object.
*/
public static AllTypesUnionStructure fromMapOfEnumToSimpleStructWithStrings(
- Map mapOfEnumToSimpleStructWithStrings) {
+ Map mapOfEnumToSimpleStructWithStrings) {
return builder().mapOfEnumToSimpleStructWithStrings(mapOfEnumToSimpleStructWithStrings).build();
}
@@ -1899,7 +1941,7 @@ public static AllTypesUnionStructure fromMapOfEnumToSimpleStructWithStrings(
* The new value for the MapOfEnumToSimpleStruct property for this object.
*/
public static AllTypesUnionStructure fromMapOfEnumToSimpleStruct(
- Map mapOfEnumToSimpleStructWithStrings) {
+ Map mapOfEnumToSimpleStructWithStrings) {
return builder().mapOfEnumToSimpleStruct(mapOfEnumToSimpleStructWithStrings).build();
}
@@ -1912,7 +1954,7 @@ public static AllTypesUnionStructure fromMapOfEnumToSimpleStruct(
* The new value for the MapOfEnumToListOfEnums property for this object.
*/
public static AllTypesUnionStructure fromMapOfEnumToListOfEnumsWithStrings(
- Map> mapOfEnumToListOfEnumsWithStrings) {
+ Map> mapOfEnumToListOfEnumsWithStrings) {
return builder().mapOfEnumToListOfEnumsWithStrings(mapOfEnumToListOfEnumsWithStrings).build();
}
@@ -1925,7 +1967,7 @@ public static AllTypesUnionStructure fromMapOfEnumToListOfEnumsWithStrings(
* The new value for the MapOfEnumToListOfEnums property for this object.
*/
public static AllTypesUnionStructure fromMapOfEnumToListOfEnums(
- Map> mapOfEnumToListOfEnumsWithStrings) {
+ Map> mapOfEnumToListOfEnumsWithStrings) {
return builder().mapOfEnumToListOfEnums(mapOfEnumToListOfEnumsWithStrings).build();
}
@@ -1939,7 +1981,7 @@ public static AllTypesUnionStructure fromMapOfEnumToListOfEnums(
* The new value for the MapOfEnumToMapOfStringToEnum property for this object.
*/
public static AllTypesUnionStructure fromMapOfEnumToMapOfStringToEnumWithStrings(
- Map> mapOfEnumToMapOfStringToEnumWithStrings) {
+ Map> mapOfEnumToMapOfStringToEnumWithStrings) {
return builder().mapOfEnumToMapOfStringToEnumWithStrings(mapOfEnumToMapOfStringToEnumWithStrings).build();
}
@@ -1953,7 +1995,7 @@ public static AllTypesUnionStructure fromMapOfEnumToMapOfStringToEnumWithStrings
* The new value for the MapOfEnumToMapOfStringToEnum property for this object.
*/
public static AllTypesUnionStructure fromMapOfEnumToMapOfStringToEnum(
- Map> mapOfEnumToMapOfStringToEnumWithStrings) {
+ Map> mapOfEnumToMapOfStringToEnumWithStrings) {
return builder().mapOfEnumToMapOfStringToEnum(mapOfEnumToMapOfStringToEnumWithStrings).build();
}
@@ -1990,7 +2032,7 @@ public static AllTypesUnionStructure fromStructWithNestedTimestampMember(StructW
* The new value for the StructWithNestedTimestampMember property for this object.
*/
public static AllTypesUnionStructure fromStructWithNestedTimestampMember(
- Consumer structWithNestedTimestampMember) {
+ Consumer structWithNestedTimestampMember) {
StructWithTimestamp.Builder builder = StructWithTimestamp.builder();
structWithNestedTimestampMember.accept(builder);
return fromStructWithNestedTimestampMember(builder.build());
@@ -2131,7 +2173,7 @@ public static AllTypesUnionStructure fromPolymorphicTypeWithoutSubTypes(SubTypeO
* The new value for the PolymorphicTypeWithoutSubTypes property for this object.
*/
public static AllTypesUnionStructure fromPolymorphicTypeWithoutSubTypes(
- Consumer polymorphicTypeWithoutSubTypes) {
+ Consumer polymorphicTypeWithoutSubTypes) {
SubTypeOne.Builder builder = SubTypeOne.builder();
polymorphicTypeWithoutSubTypes.accept(builder);
return fromPolymorphicTypeWithoutSubTypes(builder.build());
@@ -2245,6 +2287,11 @@ public final List> sdkFields() {
return SDK_FIELDS;
}
+ @Override
+ public final Map> sdkFieldNameToField() {
+ return SDK_NAME_TO_FIELD;
+ }
+
private static Function getter(Function g) {
return obj -> g.apply((AllTypesUnionStructure) obj);
}
@@ -2419,7 +2466,7 @@ public interface Builder extends SdkPojo, CopyableBuilder)}.
- *
+ *
* @param listOfStructs
* a consumer that will call methods on
* {@link software.amazon.awssdk.services.jsonprotocoltests.model.SimpleStruct.Builder}
@@ -2626,7 +2673,7 @@ public interface Builder extends SdkPojo, CopyableBuilder
* 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.
@@ -2634,7 +2681,7 @@ public interface Builder extends SdkPojo, CopyableBuilder structWithNestedTimestampMember) {
return structWithNestedTimestampMember(StructWithTimestamp.builder().applyMutation(structWithNestedTimestampMember)
- .build());
+ .build());
}
/**
@@ -2664,7 +2711,7 @@ default Builder structWithNestedTimestampMember(Consumer
* 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.
@@ -2719,7 +2766,7 @@ default Builder structWithNestedBlob(Consumer
*
* 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.
@@ -2747,7 +2794,7 @@ default Builder recursiveStruct(Consumer recursiveS
*
* 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.
@@ -2775,7 +2822,7 @@ default Builder polymorphicTypeWithSubTypes(Consumer polymorph
*
* 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.
@@ -2825,7 +2872,7 @@ default Builder polymorphicTypeWithoutSubTypes(Consumer poly
*
* 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.
@@ -2862,7 +2909,7 @@ default Builder underscore_Name_Type(Consumer unde
*
* 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.
@@ -3247,7 +3294,7 @@ public final Builder listOfStructs(SimpleStruct... listOfStructs) {
@SafeVarargs
public final Builder listOfStructs(Consumer... listOfStructs) {
listOfStructs(Stream.of(listOfStructs).map(c -> SimpleStruct.builder().applyMutation(c).build())
- .collect(Collectors.toList()));
+ .collect(Collectors.toList()));
return this;
}
@@ -3281,7 +3328,7 @@ public final Builder listOfMapOfEnumToStringWithStrings(Map... l
public final List> getListOfMapOfStringToStruct() {
List> result = ListOfMapOfStringToStructCopier
- .copyToBuilder(this.listOfMapOfStringToStruct);
+ .copyToBuilder(this.listOfMapOfStringToStruct);
if (result instanceof SdkAutoConstructList) {
return null;
}
@@ -3289,7 +3336,7 @@ public final List> getListOfMapOfStringToStruc
}
public final void setListOfMapOfStringToStruct(
- Collection extends Map> listOfMapOfStringToStruct) {
+ Collection extends Map> listOfMapOfStringToStruct) {
Object oldValue = this.listOfMapOfStringToStruct;
this.listOfMapOfStringToStruct = ListOfMapOfStringToStructCopier.copyFromBuilder(listOfMapOfStringToStruct);
handleUnionValueChange(Type.LIST_OF_MAP_OF_STRING_TO_STRUCT, oldValue, this.listOfMapOfStringToStruct);
@@ -3354,7 +3401,7 @@ public final Builder mapOfStringToString(Map mapOfStringToString
public final Map getMapOfStringToSimpleStruct() {
Map result = MapOfStringToSimpleStructCopier
- .copyToBuilder(this.mapOfStringToSimpleStruct);
+ .copyToBuilder(this.mapOfStringToSimpleStruct);
if (result instanceof SdkAutoConstructMap) {
return null;
}
@@ -3536,7 +3583,7 @@ public final void setMapOfEnumToMapOfStringToEnum(Map> mapOfEnumToMapOfStringToEnum) {
+ Map> mapOfEnumToMapOfStringToEnum) {
Object oldValue = this.mapOfEnumToMapOfStringToEnum;
this.mapOfEnumToMapOfStringToEnum = MapOfEnumToMapOfStringToEnumCopier.copy(mapOfEnumToMapOfStringToEnum);
handleUnionValueChange(Type.MAP_OF_ENUM_TO_MAP_OF_STRING_TO_ENUM, oldValue, this.mapOfEnumToMapOfStringToEnum);
@@ -3545,7 +3592,7 @@ public final Builder mapOfEnumToMapOfStringToEnumWithStrings(
@Override
public final Builder mapOfEnumToMapOfStringToEnum(
- Map> mapOfEnumToMapOfStringToEnum) {
+ Map> mapOfEnumToMapOfStringToEnum) {
Object oldValue = this.mapOfEnumToMapOfStringToEnum;
this.mapOfEnumToMapOfStringToEnum = MapOfEnumToMapOfStringToEnumCopier.copyEnumToString(mapOfEnumToMapOfStringToEnum);
handleUnionValueChange(Type.MAP_OF_ENUM_TO_MAP_OF_STRING_TO_ENUM, oldValue, this.mapOfEnumToMapOfStringToEnum);
@@ -3577,7 +3624,7 @@ public final StructWithTimestamp.Builder getStructWithNestedTimestampMember() {
public final void setStructWithNestedTimestampMember(StructWithTimestamp.BuilderImpl structWithNestedTimestampMember) {
Object oldValue = this.structWithNestedTimestampMember;
this.structWithNestedTimestampMember = structWithNestedTimestampMember != null ? structWithNestedTimestampMember
- .build() : null;
+ .build() : null;
handleUnionValueChange(Type.STRUCT_WITH_NESTED_TIMESTAMP_MEMBER, oldValue, this.structWithNestedTimestampMember);
}
@@ -3628,12 +3675,12 @@ public final Map getBlobMap() {
return null;
}
return blobMap == null ? null : blobMap.entrySet().stream()
- .collect(Collectors.toMap(e -> e.getKey(), e -> e.getValue().asByteBuffer()));
+ .collect(Collectors.toMap(e -> e.getKey(), e -> e.getValue().asByteBuffer()));
}
public final void setBlobMap(Map blobMap) {
blobMap(blobMap == null ? null : blobMap.entrySet().stream()
- .collect(Collectors.toMap(e -> e.getKey(), e -> SdkBytes.fromByteBuffer(e.getValue()))));
+ .collect(Collectors.toMap(e -> e.getKey(), e -> SdkBytes.fromByteBuffer(e.getValue()))));
}
@Override
@@ -3653,7 +3700,7 @@ public final List getListOfBlobs() {
public final void setListOfBlobs(Collection listOfBlobs) {
listOfBlobs(listOfBlobs == null ? null : listOfBlobs.stream().map(SdkBytes::fromByteBuffer)
- .collect(Collectors.toList()));
+ .collect(Collectors.toList()));
}
@Override
@@ -3714,7 +3761,7 @@ public final SubTypeOne.Builder getPolymorphicTypeWithoutSubTypes() {
public final void setPolymorphicTypeWithoutSubTypes(SubTypeOne.BuilderImpl polymorphicTypeWithoutSubTypes) {
Object oldValue = this.polymorphicTypeWithoutSubTypes;
this.polymorphicTypeWithoutSubTypes = polymorphicTypeWithoutSubTypes != null ? polymorphicTypeWithoutSubTypes.build()
- : null;
+ : null;
handleUnionValueChange(Type.POLYMORPHIC_TYPE_WITHOUT_SUB_TYPES, oldValue, this.polymorphicTypeWithoutSubTypes);
}
@@ -3814,6 +3861,11 @@ public List> sdkFields() {
return SDK_FIELDS;
}
+ @Override
+ public Map> sdkFieldNameToField() {
+ return SDK_NAME_TO_FIELD;
+ }
+
private final void handleUnionValueChange(Type type, Object oldValue, Object newValue) {
if (this.type == type || oldValue == newValue) {
return;
diff --git a/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/basetype.java b/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/basetype.java
index c185dc837ab9..d7ad45dff2b6 100644
--- a/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/basetype.java
+++ b/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/basetype.java
@@ -3,7 +3,9 @@
import java.io.Serializable;
import java.util.Arrays;
import java.util.Collections;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
@@ -23,11 +25,18 @@
@Generated("software.amazon.awssdk:codegen")
public final class BaseType implements SdkPojo, Serializable, ToCopyableBuilder {
private static final SdkField BASE_MEMBER_FIELD = SdkField. builder(MarshallingType.STRING)
- .memberName("BaseMember").getter(getter(BaseType::baseMember)).setter(setter(Builder::baseMember))
- .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("BaseMember").build()).build();
+ .memberName("BaseMember").getter(getter(BaseType::baseMember)).setter(setter(Builder::baseMember))
+ .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("BaseMember").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(BASE_MEMBER_FIELD));
+ private static final Map> SDK_NAME_TO_FIELD = Collections
+ .unmodifiableMap(new HashMap>() {
+ {
+ put("BaseMember", BASE_MEMBER_FIELD);
+ }
+ });
+
private static final long serialVersionUID = 1L;
private final String baseMember;
@@ -44,7 +53,7 @@ private BaseType(BuilderImpl builder) {
/**
* Returns the value of the BaseMember property for this object.
- *
+ *
* @return The value of the BaseMember property for this object.
*/
public final String baseMember() {
@@ -53,7 +62,7 @@ public final String baseMember() {
/**
* Custom shape of type string
- *
+ *
* @return Custom shape of type string
*/
public final String customShape1() {
@@ -62,7 +71,7 @@ public final String customShape1() {
/**
* Custom shape of type integer
- *
+ *
* @return Custom shape of type integer
*/
public final Integer customShape2() {
@@ -109,7 +118,7 @@ public final boolean equalsBySdkFields(Object obj) {
}
BaseType other = (BaseType) obj;
return Objects.equals(baseMember(), other.baseMember()) && Objects.equals(customShape1(), other.customShape1())
- && Objects.equals(customShape2(), other.customShape2());
+ && Objects.equals(customShape2(), other.customShape2());
}
/**
@@ -119,19 +128,19 @@ public final boolean equalsBySdkFields(Object obj) {
@Override
public final String toString() {
return ToString.builder("BaseType").add("BaseMember", baseMember()).add("CustomShape1", customShape1())
- .add("CustomShape2", customShape2()).build();
+ .add("CustomShape2", customShape2()).build();
}
public final Optional getValueForField(String fieldName, Class 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();
+ 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();
}
}
@@ -140,6 +149,11 @@ public final List> sdkFields() {
return SDK_FIELDS;
}
+ @Override
+ public final Map> sdkFieldNameToField() {
+ return SDK_NAME_TO_FIELD;
+ }
+
private static Function getter(Function g) {
return obj -> g.apply((BaseType) obj);
}
@@ -160,7 +174,7 @@ public interface Builder extends SdkPojo, CopyableBuilder {
/**
* 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.
@@ -169,7 +183,7 @@ public interface Builder extends SdkPojo, CopyableBuilder {
/**
* 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.
@@ -244,5 +258,10 @@ public BaseType build() {
public List> sdkFields() {
return SDK_FIELDS;
}
+
+ @Override
+ public Map> sdkFieldNameToField() {
+ return SDK_NAME_TO_FIELD;
+ }
}
}
diff --git a/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/deprecatedrenamerequest.java b/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/deprecatedrenamerequest.java
index 9a4d9ee156f5..bde519652764 100644
--- a/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/deprecatedrenamerequest.java
+++ b/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/deprecatedrenamerequest.java
@@ -2,7 +2,9 @@
import java.util.Arrays;
import java.util.Collections;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
@@ -23,20 +25,28 @@
*/
@Generated("software.amazon.awssdk:codegen")
public final class DeprecatedRenameRequest extends JsonProtocolTestsRequest implements
- ToCopyableBuilder {
+ ToCopyableBuilder {
private static final SdkField NEW_NAME_NO_DEPRECATION_FIELD = SdkField. builder(MarshallingType.STRING)
- .memberName("NewNameNoDeprecation").getter(getter(DeprecatedRenameRequest::newNameNoDeprecation))
- .setter(setter(Builder::newNameNoDeprecation))
- .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("OriginalNameNoDeprecation").build())
- .build();
+ .memberName("NewNameNoDeprecation").getter(getter(DeprecatedRenameRequest::newNameNoDeprecation))
+ .setter(setter(Builder::newNameNoDeprecation))
+ .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("OriginalNameNoDeprecation").build())
+ .build();
private static final SdkField NEW_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
- .memberName("NewName").getter(getter(DeprecatedRenameRequest::newName)).setter(setter(Builder::newName))
- .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("OriginalNameDeprecated").build())
- .build();
+ .memberName("NewName").getter(getter(DeprecatedRenameRequest::newName)).setter(setter(Builder::newName))
+ .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("OriginalNameDeprecated").build())
+ .build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(NEW_NAME_NO_DEPRECATION_FIELD,
- NEW_NAME_FIELD));
+ NEW_NAME_FIELD));
+
+ private static final Map> SDK_NAME_TO_FIELD = Collections
+ .unmodifiableMap(new HashMap>() {
+ {
+ put("OriginalNameNoDeprecation", NEW_NAME_NO_DEPRECATION_FIELD);
+ put("OriginalNameDeprecated", NEW_NAME_FIELD);
+ }
+ });
private final String newNameNoDeprecation;
@@ -50,7 +60,7 @@ private DeprecatedRenameRequest(BuilderImpl builder) {
/**
* Returns the value of the NewNameNoDeprecation property for this object.
- *
+ *
* @return The value of the NewNameNoDeprecation property for this object.
*/
public final String newNameNoDeprecation() {
@@ -59,7 +69,7 @@ public final String 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()}
*/
@@ -70,7 +80,7 @@ public final String originalNameDeprecated() {
/**
* Returns the value of the NewName property for this object.
- *
+ *
* @return The value of the NewName property for this object.
*/
public final String newName() {
@@ -126,19 +136,19 @@ public final boolean equalsBySdkFields(Object obj) {
@Override
public final String toString() {
return ToString.builder("DeprecatedRenameRequest").add("NewNameNoDeprecation", newNameNoDeprecation())
- .add("NewName", newName()).build();
+ .add("NewName", newName()).build();
}
public final Optional getValueForField(String fieldName, Class 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();
+ 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();
}
}
@@ -147,6 +157,11 @@ public final List> sdkFields() {
return SDK_FIELDS;
}
+ @Override
+ public final Map> sdkFieldNameToField() {
+ return SDK_NAME_TO_FIELD;
+ }
+
private static Function getter(Function g) {
return obj -> g.apply((DeprecatedRenameRequest) obj);
}
@@ -269,5 +284,10 @@ public DeprecatedRenameRequest build() {
public List> sdkFields() {
return SDK_FIELDS;
}
+
+ @Override
+ public Map> sdkFieldNameToField() {
+ return SDK_NAME_TO_FIELD;
+ }
}
}
diff --git a/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/deprecatedrenameresponse.java b/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/deprecatedrenameresponse.java
index eb428b9fbefb..314d419d9431 100644
--- a/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/deprecatedrenameresponse.java
+++ b/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/deprecatedrenameresponse.java
@@ -2,7 +2,9 @@
import java.util.Arrays;
import java.util.Collections;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
@@ -21,21 +23,29 @@
*/
@Generated("software.amazon.awssdk:codegen")
public final class DeprecatedRenameResponse extends JsonProtocolTestsResponse implements
- ToCopyableBuilder {
+ ToCopyableBuilder {
private static final SdkField ORIGINAL_NAME_NO_DEPRECATION_FIELD = SdkField. builder(MarshallingType.STRING)
- .memberName("OriginalNameNoDeprecation").getter(getter(DeprecatedRenameResponse::originalNameNoDeprecation))
- .setter(setter(Builder::originalNameNoDeprecation))
- .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("OriginalNameNoDeprecation").build())
- .build();
+ .memberName("OriginalNameNoDeprecation").getter(getter(DeprecatedRenameResponse::originalNameNoDeprecation))
+ .setter(setter(Builder::originalNameNoDeprecation))
+ .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("OriginalNameNoDeprecation").build())
+ .build();
private static final SdkField ORIGINAL_NAME_DEPRECATED_FIELD = SdkField. builder(MarshallingType.STRING)
- .memberName("OriginalNameDeprecated").getter(getter(DeprecatedRenameResponse::originalNameDeprecated))
- .setter(setter(Builder::originalNameDeprecated))
- .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("OriginalNameDeprecated").build())
- .build();
+ .memberName("OriginalNameDeprecated").getter(getter(DeprecatedRenameResponse::originalNameDeprecated))
+ .setter(setter(Builder::originalNameDeprecated))
+ .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("OriginalNameDeprecated").build())
+ .build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(
- ORIGINAL_NAME_NO_DEPRECATION_FIELD, ORIGINAL_NAME_DEPRECATED_FIELD));
+ ORIGINAL_NAME_NO_DEPRECATION_FIELD, ORIGINAL_NAME_DEPRECATED_FIELD));
+
+ private static final Map> SDK_NAME_TO_FIELD = Collections
+ .unmodifiableMap(new HashMap>() {
+ {
+ put("OriginalNameNoDeprecation", ORIGINAL_NAME_NO_DEPRECATION_FIELD);
+ put("OriginalNameDeprecated", ORIGINAL_NAME_DEPRECATED_FIELD);
+ }
+ });
private final String originalNameNoDeprecation;
@@ -49,7 +59,7 @@ private DeprecatedRenameResponse(BuilderImpl builder) {
/**
* Returns the value of the OriginalNameNoDeprecation property for this object.
- *
+ *
* @return The value of the OriginalNameNoDeprecation property for this object.
*/
public final String originalNameNoDeprecation() {
@@ -58,7 +68,7 @@ public final String 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() {
@@ -105,7 +115,7 @@ public final boolean equalsBySdkFields(Object obj) {
}
DeprecatedRenameResponse other = (DeprecatedRenameResponse) obj;
return Objects.equals(originalNameNoDeprecation(), other.originalNameNoDeprecation())
- && Objects.equals(originalNameDeprecated(), other.originalNameDeprecated());
+ && Objects.equals(originalNameDeprecated(), other.originalNameDeprecated());
}
/**
@@ -115,17 +125,17 @@ public final boolean equalsBySdkFields(Object obj) {
@Override
public final String toString() {
return ToString.builder("DeprecatedRenameResponse").add("OriginalNameNoDeprecation", originalNameNoDeprecation())
- .add("OriginalNameDeprecated", originalNameDeprecated()).build();
+ .add("OriginalNameDeprecated", originalNameDeprecated()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
- case "OriginalNameNoDeprecation":
- return Optional.ofNullable(clazz.cast(originalNameNoDeprecation()));
- case "OriginalNameDeprecated":
- return Optional.ofNullable(clazz.cast(originalNameDeprecated()));
- default:
- return Optional.empty();
+ case "OriginalNameNoDeprecation":
+ return Optional.ofNullable(clazz.cast(originalNameNoDeprecation()));
+ case "OriginalNameDeprecated":
+ return Optional.ofNullable(clazz.cast(originalNameDeprecated()));
+ default:
+ return Optional.empty();
}
}
@@ -134,6 +144,11 @@ public final List> sdkFields() {
return SDK_FIELDS;
}
+ @Override
+ public final Map> sdkFieldNameToField() {
+ return SDK_NAME_TO_FIELD;
+ }
+
private static Function getter(Function g) {
return obj -> g.apply((DeprecatedRenameResponse) obj);
}
@@ -143,7 +158,7 @@ private static BiConsumer setter(BiConsumer s) {
}
public interface Builder extends JsonProtocolTestsResponse.Builder, SdkPojo,
- CopyableBuilder {
+ CopyableBuilder {
/**
* Sets the value of the OriginalNameNoDeprecation property for this object.
*
@@ -214,5 +229,10 @@ public DeprecatedRenameResponse build() {
public List> sdkFields() {
return SDK_FIELDS;
}
+
+ @Override
+ public Map> sdkFieldNameToField() {
+ return SDK_NAME_TO_FIELD;
+ }
}
}
diff --git a/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/emptymodeledexception.java b/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/emptymodeledexception.java
index 375a03a4a6c4..b0eeb19dacbb 100644
--- a/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/emptymodeledexception.java
+++ b/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/emptymodeledexception.java
@@ -1,8 +1,8 @@
package software.amazon.awssdk.services.jsonprotocoltests.model;
-import java.util.Arrays;
import java.util.Collections;
import java.util.List;
+import java.util.Map;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.awscore.exception.AwsErrorDetails;
import software.amazon.awssdk.core.SdkField;
@@ -15,7 +15,9 @@
@Generated("software.amazon.awssdk:codegen")
public final class EmptyModeledException extends JsonProtocolTestsException implements
ToCopyableBuilder {
- private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList());
+ private static final List> SDK_FIELDS = Collections.emptyList();
+
+ private static final Map> SDK_NAME_TO_FIELD = Collections.emptyMap();
private static final long serialVersionUID = 1L;
@@ -41,6 +43,11 @@ public final List> sdkFields() {
return SDK_FIELDS;
}
+ @Override
+ public final Map> sdkFieldNameToField() {
+ return SDK_NAME_TO_FIELD;
+ }
+
public interface Builder extends SdkPojo, CopyableBuilder, JsonProtocolTestsException.Builder {
@Override
Builder awsErrorDetails(AwsErrorDetails awsErrorDetails);
@@ -114,6 +121,10 @@ public EmptyModeledException build() {
public List> sdkFields() {
return SDK_FIELDS;
}
+
+ @Override
+ public Map> sdkFieldNameToField() {
+ return SDK_NAME_TO_FIELD;
+ }
}
}
-
diff --git a/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/enumtype.java b/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/enumtype.java
index a0c4de83ea1f..3b186b01f69c 100644
--- a/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/enumtype.java
+++ b/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/enumtype.java
@@ -1,8 +1,8 @@
package software.amazon.awssdk.services.jsonprotocoltests.model;
-import java.util.Arrays;
import java.util.Collections;
import java.util.List;
+import java.util.Map;
import java.util.Optional;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
@@ -12,7 +12,9 @@
*/
@Generated("software.amazon.awssdk:codegen")
public final class EnumType {
- private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList());
+ private static final List> SDK_FIELDS = Collections.emptyList();
+
+ private static final Map> SDK_NAME_TO_FIELD = Collections.emptyMap();
private EnumType(EnumType.BuilderImpl builder) {
}
@@ -72,5 +74,9 @@ public final Optional getValueForField(String fieldName, Class clazz)
public final List> sdkFields() {
return SDK_FIELDS;
}
-}
+ @Override
+ public final Map> sdkFieldNameToField() {
+ return SDK_NAME_TO_FIELD;
+ }
+}
diff --git a/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/eventone.java b/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/eventone.java
index a3ed6a8fda54..f15d3825c6f7 100644
--- a/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/eventone.java
+++ b/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/eventone.java
@@ -3,7 +3,9 @@
import java.io.Serializable;
import java.util.Arrays;
import java.util.Collections;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
@@ -24,11 +26,18 @@
@Generated("software.amazon.awssdk:codegen")
public class EventOne implements SdkPojo, Serializable, ToCopyableBuilder, EventStream {
private static final SdkField FOO_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Foo")
- .getter(getter(EventOne::foo)).setter(setter(Builder::foo))
- .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Foo").build()).build();
+ .getter(getter(EventOne::foo)).setter(setter(Builder::foo))
+ .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Foo").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(FOO_FIELD));
+ private static final Map> SDK_NAME_TO_FIELD = Collections
+ .unmodifiableMap(new HashMap>() {
+ {
+ put("Foo", FOO_FIELD);
+ }
+ });
+
private static final long serialVersionUID = 1L;
private final String foo;
@@ -39,7 +48,7 @@ protected EventOne(BuilderImpl builder) {
/**
* Returns the value of the Foo property for this object.
- *
+ *
* @return The value of the Foo property for this object.
*/
public final String foo() {
@@ -97,10 +106,10 @@ public final String toString() {
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
- case "Foo":
- return Optional.ofNullable(clazz.cast(foo()));
- default:
- return Optional.empty();
+ case "Foo":
+ return Optional.ofNullable(clazz.cast(foo()));
+ default:
+ return Optional.empty();
}
}
@@ -114,6 +123,11 @@ public final List> sdkFields() {
return SDK_FIELDS;
}
+ @Override
+ public final Map> sdkFieldNameToField() {
+ return SDK_NAME_TO_FIELD;
+ }
+
private static Function getter(Function g) {
return obj -> g.apply((EventOne) obj);
}
@@ -177,5 +191,10 @@ public EventOne build() {
public List> sdkFields() {
return SDK_FIELDS;
}
+
+ @Override
+ public Map> sdkFieldNameToField() {
+ return SDK_NAME_TO_FIELD;
+ }
}
}
diff --git a/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/eventstream.java b/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/eventstream.java
index f1496e690872..5ad94156118d 100644
--- a/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/eventstream.java
+++ b/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/eventstream.java
@@ -144,4 +144,3 @@ public static Set knownValues() {
}
}
}
-
diff --git a/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/eventstreamoperationrequest.java b/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/eventstreamoperationrequest.java
index ea0b39f4f87e..94778bb0428d 100644
--- a/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/eventstreamoperationrequest.java
+++ b/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/eventstreamoperationrequest.java
@@ -1,8 +1,8 @@
package software.amazon.awssdk.services.jsonprotocoltests.model;
-import java.util.Arrays;
import java.util.Collections;
import java.util.List;
+import java.util.Map;
import java.util.Optional;
import java.util.function.Consumer;
import software.amazon.awssdk.annotations.Generated;
@@ -18,7 +18,9 @@
@Generated("software.amazon.awssdk:codegen")
public final class EventStreamOperationRequest extends JsonProtocolTestsRequest implements
ToCopyableBuilder {
- private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList());
+ private static final List> SDK_FIELDS = Collections.emptyList();
+
+ private static final Map> SDK_NAME_TO_FIELD = Collections.emptyMap();
private EventStreamOperationRequest(BuilderImpl builder) {
super(builder);
@@ -81,6 +83,11 @@ public final List> sdkFields() {
return SDK_FIELDS;
}
+ @Override
+ public final Map> sdkFieldNameToField() {
+ return SDK_NAME_TO_FIELD;
+ }
+
public interface Builder extends JsonProtocolTestsRequest.Builder, SdkPojo,
CopyableBuilder {
@Override
@@ -119,5 +126,10 @@ public EventStreamOperationRequest build() {
public List> sdkFields() {
return SDK_FIELDS;
}
+
+ @Override
+ public Map> sdkFieldNameToField() {
+ return SDK_NAME_TO_FIELD;
+ }
}
}
diff --git a/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/eventstreamoperationresponse.java b/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/eventstreamoperationresponse.java
index c70bfc6303df..f7744730c170 100644
--- a/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/eventstreamoperationresponse.java
+++ b/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/eventstreamoperationresponse.java
@@ -1,8 +1,8 @@
package software.amazon.awssdk.services.jsonprotocoltests.model;
-import java.util.Arrays;
import java.util.Collections;
import java.util.List;
+import java.util.Map;
import java.util.Optional;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
@@ -16,7 +16,9 @@
@Generated("software.amazon.awssdk:codegen")
public final class EventStreamOperationResponse extends JsonProtocolTestsResponse implements
ToCopyableBuilder {
- private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList());
+ private static final List> SDK_FIELDS = Collections.emptyList();
+
+ private static final Map> SDK_NAME_TO_FIELD = Collections.emptyMap();
private EventStreamOperationResponse(BuilderImpl builder) {
super(builder);
@@ -79,6 +81,11 @@ public final List> sdkFields() {
return SDK_FIELDS;
}
+ @Override
+ public final Map> sdkFieldNameToField() {
+ return SDK_NAME_TO_FIELD;
+ }
+
public interface Builder extends JsonProtocolTestsResponse.Builder, SdkPojo,
CopyableBuilder {
}
@@ -100,6 +107,10 @@ public EventStreamOperationResponse build() {
public List> sdkFields() {
return SDK_FIELDS;
}
+
+ @Override
+ public Map> sdkFieldNameToField() {
+ return SDK_NAME_TO_FIELD;
+ }
}
}
-
diff --git a/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/eventstreamoperationwithonlyinputrequest.java b/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/eventstreamoperationwithonlyinputrequest.java
index 8138680b03fb..b6ce6ec1abae 100644
--- a/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/eventstreamoperationwithonlyinputrequest.java
+++ b/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/eventstreamoperationwithonlyinputrequest.java
@@ -1,8 +1,8 @@
package software.amazon.awssdk.services.jsonprotocoltests.model;
-import java.util.Arrays;
import java.util.Collections;
import java.util.List;
+import java.util.Map;
import java.util.Optional;
import java.util.function.Consumer;
import software.amazon.awssdk.annotations.Generated;
@@ -18,7 +18,9 @@
@Generated("software.amazon.awssdk:codegen")
public final class EventStreamOperationWithOnlyInputRequest extends JsonProtocolTestsRequest implements
ToCopyableBuilder {
- private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList());
+ private static final List> SDK_FIELDS = Collections.emptyList();
+
+ private static final Map> SDK_NAME_TO_FIELD = Collections.emptyMap();
private EventStreamOperationWithOnlyInputRequest(BuilderImpl builder) {
super(builder);
@@ -81,6 +83,11 @@ public final List> sdkFields() {
return SDK_FIELDS;
}
+ @Override
+ public final Map> sdkFieldNameToField() {
+ return SDK_NAME_TO_FIELD;
+ }
+
public interface Builder extends JsonProtocolTestsRequest.Builder, SdkPojo,
CopyableBuilder {
@Override
@@ -119,5 +126,10 @@ public EventStreamOperationWithOnlyInputRequest build() {
public List> sdkFields() {
return SDK_FIELDS;
}
+
+ @Override
+ public Map> sdkFieldNameToField() {
+ return SDK_NAME_TO_FIELD;
+ }
}
}
diff --git a/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/eventstreamoperationwithonlyinputresponse.java b/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/eventstreamoperationwithonlyinputresponse.java
index e787d358e571..904c763cd46b 100644
--- a/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/eventstreamoperationwithonlyinputresponse.java
+++ b/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/eventstreamoperationwithonlyinputresponse.java
@@ -1,8 +1,8 @@
package software.amazon.awssdk.services.jsonprotocoltests.model;
-import java.util.Arrays;
import java.util.Collections;
import java.util.List;
+import java.util.Map;
import java.util.Optional;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
@@ -14,7 +14,9 @@
@Generated("software.amazon.awssdk:codegen")
public final class EventStreamOperationWithOnlyInputResponse extends JsonProtocolTestsResponse implements
ToCopyableBuilder {
- private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList());
+ private static final List> SDK_FIELDS = Collections.emptyList();
+
+ private static final Map> SDK_NAME_TO_FIELD = Collections.emptyMap();
private EventStreamOperationWithOnlyInputResponse(BuilderImpl builder) {
super(builder);
@@ -77,6 +79,11 @@ public final List> sdkFields() {
return SDK_FIELDS;
}
+ @Override
+ public final Map> sdkFieldNameToField() {
+ return SDK_NAME_TO_FIELD;
+ }
+
public interface Builder extends JsonProtocolTestsResponse.Builder, SdkPojo,
CopyableBuilder {
}
@@ -98,6 +105,10 @@ public EventStreamOperationWithOnlyInputResponse build() {
public List> sdkFields() {
return SDK_FIELDS;
}
+
+ @Override
+ public Map> sdkFieldNameToField() {
+ return SDK_NAME_TO_FIELD;
+ }
}
}
-
diff --git a/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/eventtwo.java b/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/eventtwo.java
index 7479f0f1dbc2..772a720be923 100644
--- a/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/eventtwo.java
+++ b/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/eventtwo.java
@@ -3,7 +3,9 @@
import java.io.Serializable;
import java.util.Arrays;
import java.util.Collections;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
@@ -24,11 +26,18 @@
@Generated("software.amazon.awssdk:codegen")
public class EventTwo implements SdkPojo, Serializable, ToCopyableBuilder, EventStream {
private static final SdkField BAR_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Bar")
- .getter(getter(EventTwo::bar)).setter(setter(Builder::bar))
- .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Bar").build()).build();
+ .getter(getter(EventTwo::bar)).setter(setter(Builder::bar))
+ .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Bar").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(BAR_FIELD));
+ private static final Map> SDK_NAME_TO_FIELD = Collections
+ .unmodifiableMap(new HashMap>() {
+ {
+ put("Bar", BAR_FIELD);
+ }
+ });
+
private static final long serialVersionUID = 1L;
private final String bar;
@@ -39,7 +48,7 @@ protected EventTwo(BuilderImpl builder) {
/**
* Returns the value of the Bar property for this object.
- *
+ *
* @return The value of the Bar property for this object.
*/
public final String bar() {
@@ -97,10 +106,10 @@ public final String toString() {
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
- case "Bar":
- return Optional.ofNullable(clazz.cast(bar()));
- default:
- return Optional.empty();
+ case "Bar":
+ return Optional.ofNullable(clazz.cast(bar()));
+ default:
+ return Optional.empty();
}
}
@@ -114,6 +123,11 @@ public final List> sdkFields() {
return SDK_FIELDS;
}
+ @Override
+ public final Map> sdkFieldNameToField() {
+ return SDK_NAME_TO_FIELD;
+ }
+
private static Function getter(Function g) {
return obj -> g.apply((EventTwo) obj);
}
@@ -177,5 +191,10 @@ public EventTwo build() {
public List> sdkFields() {
return SDK_FIELDS;
}
+
+ @Override
+ public Map> sdkFieldNameToField() {
+ return SDK_NAME_TO_FIELD;
+ }
}
}
diff --git a/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/exceptions/jsonserviceinternalservererrorexception.java b/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/exceptions/jsonserviceinternalservererrorexception.java
index 7175fbd58f3a..fbfe4a6804f6 100644
--- a/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/exceptions/jsonserviceinternalservererrorexception.java
+++ b/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/exceptions/jsonserviceinternalservererrorexception.java
@@ -1,8 +1,8 @@
package software.amazon.awssdk.services.json.model;
-import java.util.Arrays;
import java.util.Collections;
import java.util.List;
+import java.util.Map;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.awscore.exception.AwsErrorDetails;
import software.amazon.awssdk.core.SdkField;
@@ -18,7 +18,9 @@
@Generated("software.amazon.awssdk:codegen")
public final class JsonServiceInternalServerErrorException extends JsonException implements
ToCopyableBuilder {
- private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList());
+ private static final List> SDK_FIELDS = Collections.emptyList();
+
+ private static final Map> SDK_NAME_TO_FIELD = Collections.emptyMap();
private static final long serialVersionUID = 1L;
@@ -49,6 +51,11 @@ public final List> sdkFields() {
return SDK_FIELDS;
}
+ @Override
+ public final Map> sdkFieldNameToField() {
+ return SDK_NAME_TO_FIELD;
+ }
+
public interface Builder extends SdkPojo, CopyableBuilder,
JsonException.Builder {
@Override
@@ -123,5 +130,10 @@ public JsonServiceInternalServerErrorException build() {
public List