- *
+ *
* @return The value of the SimpleList property for this object.
*/
public final List simpleList() {
@@ -655,7 +671,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() {
@@ -683,7 +699,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() {
@@ -711,7 +727,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() {
@@ -739,7 +755,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() {
@@ -755,7 +771,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() {
@@ -783,7 +799,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() {
@@ -811,7 +827,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() {
@@ -839,7 +855,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() {
@@ -867,7 +883,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() {
@@ -895,7 +911,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() {
@@ -911,7 +927,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() {
@@ -939,7 +955,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() {
@@ -955,7 +971,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() {
@@ -983,7 +999,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() {
@@ -999,7 +1015,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() {
@@ -1027,7 +1043,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() {
@@ -1043,7 +1059,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() {
@@ -1071,7 +1087,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() {
@@ -1087,7 +1103,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() {
@@ -1115,7 +1131,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() {
@@ -1131,7 +1147,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() {
@@ -1159,7 +1175,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() {
@@ -1168,7 +1184,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() {
@@ -1177,7 +1193,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() {
@@ -1186,7 +1202,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() {
@@ -1195,7 +1211,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() {
@@ -1223,7 +1239,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() {
@@ -1251,7 +1267,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() {
@@ -1260,7 +1276,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() {
@@ -1269,7 +1285,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() {
@@ -1278,7 +1294,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() {
@@ -1292,7 +1308,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
*/
@@ -1307,7 +1323,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
*/
@@ -1317,7 +1333,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() {
@@ -1326,7 +1342,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() {
@@ -1335,7 +1351,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() {
@@ -1366,6 +1382,7 @@ public final int hashCode() {
hashCode = 31 * hashCode + Objects.hashCode(doubleMember());
hashCode = 31 * hashCode + Objects.hashCode(longMember());
hashCode = 31 * hashCode + Objects.hashCode(shortMember());
+ hashCode = 31 * hashCode + Objects.hashCode(byteMember());
hashCode = 31 * hashCode + Objects.hashCode(hasSimpleList() ? simpleList() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasListOfEnums() ? listOfEnumsAsStrings() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasListOfMaps() ? listOfMaps() : null);
@@ -1381,7 +1398,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());
@@ -1416,48 +1433,49 @@ public final boolean equalsBySdkFields(Object obj) {
}
AllTypesRequest other = (AllTypesRequest) obj;
return Objects.equals(stringMember(), other.stringMember()) && Objects.equals(integerMember(), other.integerMember())
- && Objects.equals(booleanMember(), other.booleanMember()) && Objects.equals(floatMember(), other.floatMember())
- && Objects.equals(doubleMember(), other.doubleMember()) && Objects.equals(longMember(), other.longMember())
- && Objects.equals(shortMember(), other.shortMember()) && hasSimpleList() == other.hasSimpleList()
- && Objects.equals(simpleList(), other.simpleList()) && hasListOfEnums() == other.hasListOfEnums()
- && Objects.equals(listOfEnumsAsStrings(), other.listOfEnumsAsStrings())
- && hasListOfMaps() == other.hasListOfMaps() && Objects.equals(listOfMaps(), other.listOfMaps())
- && hasListOfStructs() == other.hasListOfStructs() && Objects.equals(listOfStructs(), other.listOfStructs())
- && hasListOfMapOfEnumToString() == other.hasListOfMapOfEnumToString()
- && Objects.equals(listOfMapOfEnumToStringAsStrings(), other.listOfMapOfEnumToStringAsStrings())
- && hasListOfMapOfStringToStruct() == other.hasListOfMapOfStringToStruct()
- && Objects.equals(listOfMapOfStringToStruct(), other.listOfMapOfStringToStruct())
- && hasMapOfStringToIntegerList() == other.hasMapOfStringToIntegerList()
- && Objects.equals(mapOfStringToIntegerList(), other.mapOfStringToIntegerList())
- && hasMapOfStringToString() == other.hasMapOfStringToString()
- && Objects.equals(mapOfStringToString(), other.mapOfStringToString())
- && hasMapOfStringToSimpleStruct() == other.hasMapOfStringToSimpleStruct()
- && Objects.equals(mapOfStringToSimpleStruct(), other.mapOfStringToSimpleStruct())
- && hasMapOfEnumToEnum() == other.hasMapOfEnumToEnum()
- && Objects.equals(mapOfEnumToEnumAsStrings(), other.mapOfEnumToEnumAsStrings())
- && hasMapOfEnumToString() == other.hasMapOfEnumToString()
- && Objects.equals(mapOfEnumToStringAsStrings(), other.mapOfEnumToStringAsStrings())
- && hasMapOfStringToEnum() == other.hasMapOfStringToEnum()
- && Objects.equals(mapOfStringToEnumAsStrings(), other.mapOfStringToEnumAsStrings())
- && hasMapOfEnumToSimpleStruct() == other.hasMapOfEnumToSimpleStruct()
- && Objects.equals(mapOfEnumToSimpleStructAsStrings(), other.mapOfEnumToSimpleStructAsStrings())
- && hasMapOfEnumToListOfEnums() == other.hasMapOfEnumToListOfEnums()
- && Objects.equals(mapOfEnumToListOfEnumsAsStrings(), other.mapOfEnumToListOfEnumsAsStrings())
- && hasMapOfEnumToMapOfStringToEnum() == other.hasMapOfEnumToMapOfStringToEnum()
- && Objects.equals(mapOfEnumToMapOfStringToEnumAsStrings(), other.mapOfEnumToMapOfStringToEnumAsStrings())
- && Objects.equals(timestampMember(), other.timestampMember())
- && Objects.equals(structWithNestedTimestampMember(), other.structWithNestedTimestampMember())
- && Objects.equals(blobArg(), other.blobArg())
- && Objects.equals(structWithNestedBlob(), other.structWithNestedBlob()) && hasBlobMap() == other.hasBlobMap()
- && Objects.equals(blobMap(), other.blobMap()) && hasListOfBlobs() == other.hasListOfBlobs()
- && Objects.equals(listOfBlobs(), other.listOfBlobs())
- && Objects.equals(recursiveStruct(), other.recursiveStruct())
- && Objects.equals(polymorphicTypeWithSubTypes(), other.polymorphicTypeWithSubTypes())
- && Objects.equals(polymorphicTypeWithoutSubTypes(), other.polymorphicTypeWithoutSubTypes())
- && Objects.equals(enumTypeAsString(), other.enumTypeAsString())
- && Objects.equals(underscore_Name_Type(), other.underscore_Name_Type())
- && Objects.equals(myDocument(), other.myDocument())
- && Objects.equals(allTypesUnionStructure(), other.allTypesUnionStructure());
+ && 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()) && Objects.equals(byteMember(), other.byteMember())
+ && 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());
}
/**
@@ -1467,114 +1485,117 @@ && hasMapOfEnumToMapOfStringToEnum() == other.hasMapOfEnumToMapOfStringToEnum()
@Override
public final String toString() {
return ToString
- .builder("AllTypesRequest")
- .add("StringMember", stringMember())
- .add("IntegerMember", integerMember())
- .add("BooleanMember", booleanMember())
- .add("FloatMember", floatMember())
- .add("DoubleMember", doubleMember())
- .add("LongMember", longMember())
- .add("ShortMember", shortMember())
- .add("SimpleList", hasSimpleList() ? simpleList() : null)
- .add("ListOfEnums", hasListOfEnums() ? listOfEnumsAsStrings() : null)
- .add("ListOfMaps", hasListOfMaps() ? listOfMaps() : null)
- .add("ListOfStructs", hasListOfStructs() ? listOfStructs() : null)
- .add("ListOfMapOfEnumToString", hasListOfMapOfEnumToString() ? listOfMapOfEnumToStringAsStrings() : null)
- .add("ListOfMapOfStringToStruct", hasListOfMapOfStringToStruct() ? listOfMapOfStringToStruct() : null)
- .add("MapOfStringToIntegerList", hasMapOfStringToIntegerList() ? mapOfStringToIntegerList() : null)
- .add("MapOfStringToString", hasMapOfStringToString() ? mapOfStringToString() : null)
- .add("MapOfStringToSimpleStruct", hasMapOfStringToSimpleStruct() ? mapOfStringToSimpleStruct() : null)
- .add("MapOfEnumToEnum", hasMapOfEnumToEnum() ? mapOfEnumToEnumAsStrings() : null)
- .add("MapOfEnumToString", hasMapOfEnumToString() ? mapOfEnumToStringAsStrings() : null)
- .add("MapOfStringToEnum", hasMapOfStringToEnum() ? mapOfStringToEnumAsStrings() : null)
- .add("MapOfEnumToSimpleStruct", hasMapOfEnumToSimpleStruct() ? mapOfEnumToSimpleStructAsStrings() : null)
- .add("MapOfEnumToListOfEnums", hasMapOfEnumToListOfEnums() ? mapOfEnumToListOfEnumsAsStrings() : null)
- .add("MapOfEnumToMapOfStringToEnum",
- hasMapOfEnumToMapOfStringToEnum() ? mapOfEnumToMapOfStringToEnumAsStrings() : null)
- .add("TimestampMember", timestampMember())
- .add("StructWithNestedTimestampMember", structWithNestedTimestampMember()).add("BlobArg", blobArg())
- .add("StructWithNestedBlob", structWithNestedBlob()).add("BlobMap", hasBlobMap() ? blobMap() : null)
- .add("ListOfBlobs", hasListOfBlobs() ? listOfBlobs() : null).add("RecursiveStruct", recursiveStruct())
- .add("PolymorphicTypeWithSubTypes", polymorphicTypeWithSubTypes())
- .add("PolymorphicTypeWithoutSubTypes", polymorphicTypeWithoutSubTypes()).add("EnumType", enumTypeAsString())
- .add("Underscore_Name_Type", underscore_Name_Type()).add("MyDocument", myDocument())
- .add("AllTypesUnionStructure", allTypesUnionStructure()).build();
+ .builder("AllTypesRequest")
+ .add("StringMember", stringMember())
+ .add("IntegerMember", integerMember())
+ .add("BooleanMember", booleanMember())
+ .add("FloatMember", floatMember())
+ .add("DoubleMember", doubleMember())
+ .add("LongMember", longMember())
+ .add("ShortMember", shortMember())
+ .add("ByteMember", byteMember())
+ .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 "ByteMember":
+ return Optional.ofNullable(clazz.cast(byteMember()));
+ 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();
}
}
@@ -1655,6 +1676,15 @@ public interface Builder extends JsonProtocolTestsRequest.Builder, SdkPojo, Copy
*/
Builder shortMember(Short shortMember);
+ /**
+ * Sets the value of the ByteMember property for this object.
+ *
+ * @param byteMember
+ * The new value for the ByteMember property for this object.
+ * @return Returns a reference to this object so that method calls can be chained together.
+ */
+ Builder byteMember(Byte byteMember);
+
/**
* Sets the value of the SimpleList property for this object.
*
@@ -1757,7 +1787,7 @@ public interface Builder extends JsonProtocolTestsRequest.Builder, SdkPojo, Copy
* When the {@link Consumer} completes,
* {@link software.amazon.awssdk.services.jsonprotocoltests.model.SimpleStruct.Builder#build()} is called
* immediately and its result is passed to {@link #listOfStructs(List)}.
- *
+ *
* @param listOfStructs
* a consumer that will call methods on
* {@link software.amazon.awssdk.services.jsonprotocoltests.model.SimpleStruct.Builder}
@@ -1964,7 +1994,7 @@ public interface Builder extends JsonProtocolTestsRequest.Builder, SdkPojo, Copy
*
* 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.
@@ -1972,7 +2002,7 @@ public interface Builder extends JsonProtocolTestsRequest.Builder, SdkPojo, Copy
*/
default Builder structWithNestedTimestampMember(Consumer structWithNestedTimestampMember) {
return structWithNestedTimestampMember(StructWithTimestamp.builder().applyMutation(structWithNestedTimestampMember)
- .build());
+ .build());
}
/**
@@ -2002,7 +2032,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.
@@ -2057,7 +2087,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.
@@ -2085,7 +2115,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.
@@ -2113,7 +2143,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.
@@ -2163,7 +2193,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.
@@ -2200,7 +2230,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.
@@ -2232,6 +2262,8 @@ static final class BuilderImpl extends JsonProtocolTestsRequest.BuilderImpl impl
private Short shortMember;
+ private Byte byteMember;
+
private List simpleList = DefaultSdkAutoConstructList.getInstance();
private List listOfEnums = DefaultSdkAutoConstructList.getInstance();
@@ -2300,6 +2332,7 @@ private BuilderImpl(AllTypesRequest model) {
doubleMember(model.doubleMember);
longMember(model.longMember);
shortMember(model.shortMember);
+ byteMember(model.byteMember);
simpleList(model.simpleList);
listOfEnumsWithStrings(model.listOfEnums);
listOfMaps(model.listOfMaps);
@@ -2428,6 +2461,20 @@ public final Builder shortMember(Short shortMember) {
return this;
}
+ public final Byte getByteMember() {
+ return byteMember;
+ }
+
+ public final void setByteMember(Byte byteMember) {
+ this.byteMember = byteMember;
+ }
+
+ @Override
+ public final Builder byteMember(Byte byteMember) {
+ this.byteMember = byteMember;
+ return this;
+ }
+
public final Collection getSimpleList() {
if (simpleList instanceof SdkAutoConstructList) {
return null;
@@ -2542,7 +2589,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;
}
@@ -2572,7 +2619,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;
}
@@ -2580,7 +2627,7 @@ public final List> getListOfMapOfStringToStruc
}
public final void setListOfMapOfStringToStruct(
- Collection extends Map> listOfMapOfStringToStruct) {
+ Collection extends Map> listOfMapOfStringToStruct) {
this.listOfMapOfStringToStruct = ListOfMapOfStringToStructCopier.copyFromBuilder(listOfMapOfStringToStruct);
}
@@ -2633,7 +2680,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;
}
@@ -2779,14 +2826,14 @@ public final void setMapOfEnumToMapOfStringToEnum(Map> mapOfEnumToMapOfStringToEnum) {
+ Map> mapOfEnumToMapOfStringToEnum) {
this.mapOfEnumToMapOfStringToEnum = MapOfEnumToMapOfStringToEnumCopier.copy(mapOfEnumToMapOfStringToEnum);
return this;
}
@Override
public final Builder mapOfEnumToMapOfStringToEnum(
- Map> mapOfEnumToMapOfStringToEnum) {
+ Map> mapOfEnumToMapOfStringToEnum) {
this.mapOfEnumToMapOfStringToEnum = MapOfEnumToMapOfStringToEnumCopier.copyEnumToString(mapOfEnumToMapOfStringToEnum);
return this;
}
@@ -2811,7 +2858,7 @@ public final StructWithTimestamp.Builder getStructWithNestedTimestampMember() {
public final void setStructWithNestedTimestampMember(StructWithTimestamp.BuilderImpl structWithNestedTimestampMember) {
this.structWithNestedTimestampMember = structWithNestedTimestampMember != null ? structWithNestedTimestampMember
- .build() : null;
+ .build() : null;
}
@Override
@@ -2853,12 +2900,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
@@ -2876,7 +2923,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
@@ -2926,7 +2973,7 @@ public final SubTypeOne.Builder getPolymorphicTypeWithoutSubTypes() {
public final void setPolymorphicTypeWithoutSubTypes(SubTypeOne.BuilderImpl polymorphicTypeWithoutSubTypes) {
this.polymorphicTypeWithoutSubTypes = polymorphicTypeWithoutSubTypes != null ? polymorphicTypeWithoutSubTypes.build()
- : null;
+ : null;
}
@Override
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 ea1c98f4518b..27335cef0cec 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
@@ -36,414 +36,418 @@
*/
@Generated("software.amazon.awssdk:codegen")
public final class AllTypesResponse extends JsonProtocolTestsResponse implements
- ToCopyableBuilder {
+ ToCopyableBuilder {
private static final SdkField STRING_MEMBER_FIELD = SdkField. builder(MarshallingType.STRING)
- .memberName("StringMember").getter(getter(AllTypesResponse::stringMember)).setter(setter(Builder::stringMember))
- .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StringMember").build()).build();
+ .memberName("StringMember").getter(getter(AllTypesResponse::stringMember)).setter(setter(Builder::stringMember))
+ .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StringMember").build()).build();
private static final SdkField INTEGER_MEMBER_FIELD = SdkField. builder(MarshallingType.INTEGER)
- .memberName("IntegerMember").getter(getter(AllTypesResponse::integerMember)).setter(setter(Builder::integerMember))
- .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("IntegerMember").build()).build();
+ .memberName("IntegerMember").getter(getter(AllTypesResponse::integerMember)).setter(setter(Builder::integerMember))
+ .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("IntegerMember").build()).build();
private static final SdkField BOOLEAN_MEMBER_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
- .memberName("BooleanMember").getter(getter(AllTypesResponse::booleanMember)).setter(setter(Builder::booleanMember))
- .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("BooleanMember").build()).build();
+ .memberName("BooleanMember").getter(getter(AllTypesResponse::booleanMember)).setter(setter(Builder::booleanMember))
+ .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("BooleanMember").build()).build();
private static final SdkField FLOAT_MEMBER_FIELD = SdkField. builder(MarshallingType.FLOAT)
- .memberName("FloatMember").getter(getter(AllTypesResponse::floatMember)).setter(setter(Builder::floatMember))
- .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("FloatMember").build()).build();
+ .memberName("FloatMember").getter(getter(AllTypesResponse::floatMember)).setter(setter(Builder::floatMember))
+ .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("FloatMember").build()).build();
private static final SdkField DOUBLE_MEMBER_FIELD = SdkField. builder(MarshallingType.DOUBLE)
- .memberName("DoubleMember").getter(getter(AllTypesResponse::doubleMember)).setter(setter(Builder::doubleMember))
- .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DoubleMember").build()).build();
+ .memberName("DoubleMember").getter(getter(AllTypesResponse::doubleMember)).setter(setter(Builder::doubleMember))
+ .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DoubleMember").build()).build();
private static final SdkField LONG_MEMBER_FIELD = SdkField. builder(MarshallingType.LONG)
- .memberName("LongMember").getter(getter(AllTypesResponse::longMember)).setter(setter(Builder::longMember))
- .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LongMember").build()).build();
+ .memberName("LongMember").getter(getter(AllTypesResponse::longMember)).setter(setter(Builder::longMember))
+ .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LongMember").build()).build();
private static final SdkField SHORT_MEMBER_FIELD = SdkField. builder(MarshallingType.SHORT)
- .memberName("ShortMember").getter(getter(AllTypesResponse::shortMember)).setter(setter(Builder::shortMember))
- .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ShortMember").build()).build();
+ .memberName("ShortMember").getter(getter(AllTypesResponse::shortMember)).setter(setter(Builder::shortMember))
+ .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ShortMember").build()).build();
+
+ private static final SdkField BYTE_MEMBER_FIELD = SdkField. builder(MarshallingType.BYTE)
+ .memberName("ByteMember").getter(getter(AllTypesResponse::byteMember)).setter(setter(Builder::byteMember))
+ .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ByteMember").build()).build();
private static final SdkField> SIMPLE_LIST_FIELD = SdkField
- .> builder(MarshallingType.LIST)
- .memberName("SimpleList")
- .getter(getter(AllTypesResponse::simpleList))
- .setter(setter(Builder::simpleList))
- .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SimpleList").build(),
- ListTrait
- .builder()
- .memberLocationName(null)
- .memberFieldInfo(
- SdkField. builder(MarshallingType.STRING)
- .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
- .locationName("member").build()).build()).build()).build();
+ .> builder(MarshallingType.LIST)
+ .memberName("SimpleList")
+ .getter(getter(AllTypesResponse::simpleList))
+ .setter(setter(Builder::simpleList))
+ .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SimpleList").build(),
+ ListTrait
+ .builder()
+ .memberLocationName(null)
+ .memberFieldInfo(
+ SdkField. 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(AllTypesResponse::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(AllTypesResponse::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(AllTypesResponse::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(AllTypesResponse::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(AllTypesResponse::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(AllTypesResponse::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(AllTypesResponse::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(AllTypesResponse::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(AllTypesResponse::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(AllTypesResponse::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(AllTypesResponse::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(AllTypesResponse::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(AllTypesResponse::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(AllTypesResponse::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(AllTypesResponse::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(AllTypesResponse::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(AllTypesResponse::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(AllTypesResponse::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(AllTypesResponse::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(AllTypesResponse::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(AllTypesResponse::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(AllTypesResponse::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(AllTypesResponse::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(AllTypesResponse::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(AllTypesResponse::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(AllTypesResponse::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(AllTypesResponse::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(AllTypesResponse::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(AllTypesResponse::timestampMember))
- .setter(setter(Builder::timestampMember))
- .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TimestampMember").build()).build();
+ .memberName("TimestampMember").getter(getter(AllTypesResponse::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(AllTypesResponse::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(AllTypesResponse::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(AllTypesResponse::blobArg)).setter(setter(Builder::blobArg))
- .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("BlobArg").build()).build();
+ .memberName("BlobArg").getter(getter(AllTypesResponse::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(AllTypesResponse::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(AllTypesResponse::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(AllTypesResponse::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(AllTypesResponse::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(AllTypesResponse::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(AllTypesResponse::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(AllTypesResponse::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(AllTypesResponse::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(AllTypesResponse::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(AllTypesResponse::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(AllTypesResponse::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(AllTypesResponse::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(AllTypesResponse::enumTypeAsString)).setter(setter(Builder::enumType))
- .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EnumType").build()).build();
+ .memberName("EnumType").getter(getter(AllTypesResponse::enumTypeAsString)).setter(setter(Builder::enumType))
+ .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EnumType").build()).build();
private static final SdkField UNDERSCORE_NAME_TYPE_FIELD = SdkField
- . builder(MarshallingType.SDK_POJO).memberName("Underscore_Name_Type")
- .getter(getter(AllTypesResponse::underscore_Name_Type)).setter(setter(Builder::underscore_Name_Type))
- .constructor(Underscore_Name_Type::builder)
- .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Underscore_Name_Type").build())
- .build();
+ . builder(MarshallingType.SDK_POJO).memberName("Underscore_Name_Type")
+ .getter(getter(AllTypesResponse::underscore_Name_Type)).setter(setter(Builder::underscore_Name_Type))
+ .constructor(Underscore_Name_Type::builder)
+ .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Underscore_Name_Type").build())
+ .build();
private static final SdkField MY_DOCUMENT_FIELD = SdkField. builder(MarshallingType.DOCUMENT)
- .memberName("MyDocument").getter(getter(AllTypesResponse::myDocument)).setter(setter(Builder::myDocument))
- .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MyDocument").build()).build();
+ .memberName("MyDocument").getter(getter(AllTypesResponse::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(AllTypesResponse::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(AllTypesResponse::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, BYTE_MEMBER_FIELD, SIMPLE_LIST_FIELD, LIST_OF_ENUMS_FIELD, LIST_OF_MAPS_FIELD,
+ LIST_OF_STRUCTS_FIELD, LIST_OF_MAP_OF_ENUM_TO_STRING_FIELD, LIST_OF_MAP_OF_STRING_TO_STRUCT_FIELD,
+ MAP_OF_STRING_TO_INTEGER_LIST_FIELD, MAP_OF_STRING_TO_STRING_FIELD, MAP_OF_STRING_TO_SIMPLE_STRUCT_FIELD,
+ MAP_OF_ENUM_TO_ENUM_FIELD, MAP_OF_ENUM_TO_STRING_FIELD, MAP_OF_STRING_TO_ENUM_FIELD,
+ MAP_OF_ENUM_TO_SIMPLE_STRUCT_FIELD, MAP_OF_ENUM_TO_LIST_OF_ENUMS_FIELD, MAP_OF_ENUM_TO_MAP_OF_STRING_TO_ENUM_FIELD,
+ TIMESTAMP_MEMBER_FIELD, STRUCT_WITH_NESTED_TIMESTAMP_MEMBER_FIELD, BLOB_ARG_FIELD, STRUCT_WITH_NESTED_BLOB_FIELD,
+ BLOB_MAP_FIELD, LIST_OF_BLOBS_FIELD, RECURSIVE_STRUCT_FIELD, POLYMORPHIC_TYPE_WITH_SUB_TYPES_FIELD,
+ POLYMORPHIC_TYPE_WITHOUT_SUB_TYPES_FIELD, ENUM_TYPE_FIELD, UNDERSCORE_NAME_TYPE_FIELD, MY_DOCUMENT_FIELD,
+ ALL_TYPES_UNION_STRUCTURE_FIELD));
private final String stringMember;
@@ -459,6 +463,8 @@ SdkField. builder(MarshallingType.SDK_BYTES)
private final Short shortMember;
+ private final Byte byteMember;
+
private final List simpleList;
private final List listOfEnums;
@@ -524,6 +530,7 @@ private AllTypesResponse(BuilderImpl builder) {
this.doubleMember = builder.doubleMember;
this.longMember = builder.longMember;
this.shortMember = builder.shortMember;
+ this.byteMember = builder.byteMember;
this.simpleList = builder.simpleList;
this.listOfEnums = builder.listOfEnums;
this.listOfMaps = builder.listOfMaps;
@@ -556,7 +563,7 @@ private AllTypesResponse(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() {
@@ -565,7 +572,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() {
@@ -574,7 +581,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() {
@@ -583,7 +590,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() {
@@ -592,7 +599,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() {
@@ -601,7 +608,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() {
@@ -610,13 +617,22 @@ 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() {
return shortMember;
}
+ /**
+ * Returns the value of the ByteMember property for this object.
+ *
+ * @return The value of the ByteMember property for this object.
+ */
+ public final Byte byteMember() {
+ return byteMember;
+ }
+
/**
* For responses, this returns true if the service returned a value for the SimpleList property. This DOES NOT check
* that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is
@@ -638,7 +654,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() {
@@ -654,7 +670,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() {
@@ -682,7 +698,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() {
@@ -710,7 +726,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() {
@@ -738,7 +754,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() {
@@ -754,7 +770,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() {
@@ -782,7 +798,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() {
@@ -810,7 +826,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() {
@@ -838,7 +854,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() {
@@ -866,7 +882,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() {
@@ -894,7 +910,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() {
@@ -910,7 +926,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() {
@@ -938,7 +954,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() {
@@ -954,7 +970,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() {
@@ -982,7 +998,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() {
@@ -998,7 +1014,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() {
@@ -1026,7 +1042,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() {
@@ -1042,7 +1058,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() {
@@ -1070,7 +1086,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() {
@@ -1086,7 +1102,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() {
@@ -1114,7 +1130,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() {
@@ -1130,7 +1146,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() {
@@ -1158,7 +1174,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() {
@@ -1167,7 +1183,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() {
@@ -1176,7 +1192,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() {
@@ -1185,7 +1201,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() {
@@ -1194,7 +1210,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() {
@@ -1222,7 +1238,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() {
@@ -1250,7 +1266,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() {
@@ -1259,7 +1275,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() {
@@ -1268,7 +1284,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() {
@@ -1277,7 +1293,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() {
@@ -1291,7 +1307,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
*/
@@ -1306,7 +1322,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
*/
@@ -1316,7 +1332,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() {
@@ -1325,7 +1341,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() {
@@ -1334,7 +1350,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() {
@@ -1365,6 +1381,7 @@ public final int hashCode() {
hashCode = 31 * hashCode + Objects.hashCode(doubleMember());
hashCode = 31 * hashCode + Objects.hashCode(longMember());
hashCode = 31 * hashCode + Objects.hashCode(shortMember());
+ hashCode = 31 * hashCode + Objects.hashCode(byteMember());
hashCode = 31 * hashCode + Objects.hashCode(hasSimpleList() ? simpleList() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasListOfEnums() ? listOfEnumsAsStrings() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasListOfMaps() ? listOfMaps() : null);
@@ -1380,7 +1397,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());
@@ -1415,48 +1432,49 @@ public final boolean equalsBySdkFields(Object obj) {
}
AllTypesResponse other = (AllTypesResponse) obj;
return Objects.equals(stringMember(), other.stringMember()) && Objects.equals(integerMember(), other.integerMember())
- && Objects.equals(booleanMember(), other.booleanMember()) && Objects.equals(floatMember(), other.floatMember())
- && Objects.equals(doubleMember(), other.doubleMember()) && Objects.equals(longMember(), other.longMember())
- && Objects.equals(shortMember(), other.shortMember()) && hasSimpleList() == other.hasSimpleList()
- && Objects.equals(simpleList(), other.simpleList()) && hasListOfEnums() == other.hasListOfEnums()
- && Objects.equals(listOfEnumsAsStrings(), other.listOfEnumsAsStrings())
- && hasListOfMaps() == other.hasListOfMaps() && Objects.equals(listOfMaps(), other.listOfMaps())
- && hasListOfStructs() == other.hasListOfStructs() && Objects.equals(listOfStructs(), other.listOfStructs())
- && hasListOfMapOfEnumToString() == other.hasListOfMapOfEnumToString()
- && Objects.equals(listOfMapOfEnumToStringAsStrings(), other.listOfMapOfEnumToStringAsStrings())
- && hasListOfMapOfStringToStruct() == other.hasListOfMapOfStringToStruct()
- && Objects.equals(listOfMapOfStringToStruct(), other.listOfMapOfStringToStruct())
- && hasMapOfStringToIntegerList() == other.hasMapOfStringToIntegerList()
- && Objects.equals(mapOfStringToIntegerList(), other.mapOfStringToIntegerList())
- && hasMapOfStringToString() == other.hasMapOfStringToString()
- && Objects.equals(mapOfStringToString(), other.mapOfStringToString())
- && hasMapOfStringToSimpleStruct() == other.hasMapOfStringToSimpleStruct()
- && Objects.equals(mapOfStringToSimpleStruct(), other.mapOfStringToSimpleStruct())
- && hasMapOfEnumToEnum() == other.hasMapOfEnumToEnum()
- && Objects.equals(mapOfEnumToEnumAsStrings(), other.mapOfEnumToEnumAsStrings())
- && hasMapOfEnumToString() == other.hasMapOfEnumToString()
- && Objects.equals(mapOfEnumToStringAsStrings(), other.mapOfEnumToStringAsStrings())
- && hasMapOfStringToEnum() == other.hasMapOfStringToEnum()
- && Objects.equals(mapOfStringToEnumAsStrings(), other.mapOfStringToEnumAsStrings())
- && hasMapOfEnumToSimpleStruct() == other.hasMapOfEnumToSimpleStruct()
- && Objects.equals(mapOfEnumToSimpleStructAsStrings(), other.mapOfEnumToSimpleStructAsStrings())
- && hasMapOfEnumToListOfEnums() == other.hasMapOfEnumToListOfEnums()
- && Objects.equals(mapOfEnumToListOfEnumsAsStrings(), other.mapOfEnumToListOfEnumsAsStrings())
- && hasMapOfEnumToMapOfStringToEnum() == other.hasMapOfEnumToMapOfStringToEnum()
- && Objects.equals(mapOfEnumToMapOfStringToEnumAsStrings(), other.mapOfEnumToMapOfStringToEnumAsStrings())
- && Objects.equals(timestampMember(), other.timestampMember())
- && Objects.equals(structWithNestedTimestampMember(), other.structWithNestedTimestampMember())
- && Objects.equals(blobArg(), other.blobArg())
- && Objects.equals(structWithNestedBlob(), other.structWithNestedBlob()) && hasBlobMap() == other.hasBlobMap()
- && Objects.equals(blobMap(), other.blobMap()) && hasListOfBlobs() == other.hasListOfBlobs()
- && Objects.equals(listOfBlobs(), other.listOfBlobs())
- && Objects.equals(recursiveStruct(), other.recursiveStruct())
- && Objects.equals(polymorphicTypeWithSubTypes(), other.polymorphicTypeWithSubTypes())
- && Objects.equals(polymorphicTypeWithoutSubTypes(), other.polymorphicTypeWithoutSubTypes())
- && Objects.equals(enumTypeAsString(), other.enumTypeAsString())
- && Objects.equals(underscore_Name_Type(), other.underscore_Name_Type())
- && Objects.equals(myDocument(), other.myDocument())
- && Objects.equals(allTypesUnionStructure(), other.allTypesUnionStructure());
+ && 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()) && Objects.equals(byteMember(), other.byteMember())
+ && 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());
}
/**
@@ -1466,114 +1484,117 @@ && hasMapOfEnumToMapOfStringToEnum() == other.hasMapOfEnumToMapOfStringToEnum()
@Override
public final String toString() {
return ToString
- .builder("AllTypesResponse")
- .add("StringMember", stringMember())
- .add("IntegerMember", integerMember())
- .add("BooleanMember", booleanMember())
- .add("FloatMember", floatMember())
- .add("DoubleMember", doubleMember())
- .add("LongMember", longMember())
- .add("ShortMember", shortMember())
- .add("SimpleList", hasSimpleList() ? simpleList() : null)
- .add("ListOfEnums", hasListOfEnums() ? listOfEnumsAsStrings() : null)
- .add("ListOfMaps", hasListOfMaps() ? listOfMaps() : null)
- .add("ListOfStructs", hasListOfStructs() ? listOfStructs() : null)
- .add("ListOfMapOfEnumToString", hasListOfMapOfEnumToString() ? listOfMapOfEnumToStringAsStrings() : null)
- .add("ListOfMapOfStringToStruct", hasListOfMapOfStringToStruct() ? listOfMapOfStringToStruct() : null)
- .add("MapOfStringToIntegerList", hasMapOfStringToIntegerList() ? mapOfStringToIntegerList() : null)
- .add("MapOfStringToString", hasMapOfStringToString() ? mapOfStringToString() : null)
- .add("MapOfStringToSimpleStruct", hasMapOfStringToSimpleStruct() ? mapOfStringToSimpleStruct() : null)
- .add("MapOfEnumToEnum", hasMapOfEnumToEnum() ? mapOfEnumToEnumAsStrings() : null)
- .add("MapOfEnumToString", hasMapOfEnumToString() ? mapOfEnumToStringAsStrings() : null)
- .add("MapOfStringToEnum", hasMapOfStringToEnum() ? mapOfStringToEnumAsStrings() : null)
- .add("MapOfEnumToSimpleStruct", hasMapOfEnumToSimpleStruct() ? mapOfEnumToSimpleStructAsStrings() : null)
- .add("MapOfEnumToListOfEnums", hasMapOfEnumToListOfEnums() ? mapOfEnumToListOfEnumsAsStrings() : null)
- .add("MapOfEnumToMapOfStringToEnum",
- hasMapOfEnumToMapOfStringToEnum() ? mapOfEnumToMapOfStringToEnumAsStrings() : null)
- .add("TimestampMember", timestampMember())
- .add("StructWithNestedTimestampMember", structWithNestedTimestampMember()).add("BlobArg", blobArg())
- .add("StructWithNestedBlob", structWithNestedBlob()).add("BlobMap", hasBlobMap() ? blobMap() : null)
- .add("ListOfBlobs", hasListOfBlobs() ? listOfBlobs() : null).add("RecursiveStruct", recursiveStruct())
- .add("PolymorphicTypeWithSubTypes", polymorphicTypeWithSubTypes())
- .add("PolymorphicTypeWithoutSubTypes", polymorphicTypeWithoutSubTypes()).add("EnumType", enumTypeAsString())
- .add("Underscore_Name_Type", underscore_Name_Type()).add("MyDocument", myDocument())
- .add("AllTypesUnionStructure", allTypesUnionStructure()).build();
+ .builder("AllTypesResponse")
+ .add("StringMember", stringMember())
+ .add("IntegerMember", integerMember())
+ .add("BooleanMember", booleanMember())
+ .add("FloatMember", floatMember())
+ .add("DoubleMember", doubleMember())
+ .add("LongMember", longMember())
+ .add("ShortMember", shortMember())
+ .add("ByteMember", byteMember())
+ .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 "ByteMember":
+ return Optional.ofNullable(clazz.cast(byteMember()));
+ 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();
}
}
@@ -1654,6 +1675,15 @@ public interface Builder extends JsonProtocolTestsResponse.Builder, SdkPojo, Cop
*/
Builder shortMember(Short shortMember);
+ /**
+ * Sets the value of the ByteMember property for this object.
+ *
+ * @param byteMember
+ * The new value for the ByteMember property for this object.
+ * @return Returns a reference to this object so that method calls can be chained together.
+ */
+ Builder byteMember(Byte byteMember);
+
/**
* Sets the value of the SimpleList property for this object.
*
@@ -1756,7 +1786,7 @@ public interface Builder extends JsonProtocolTestsResponse.Builder, SdkPojo, Cop
* When the {@link Consumer} completes,
* {@link software.amazon.awssdk.services.jsonprotocoltests.model.SimpleStruct.Builder#build()} is called
* immediately and its result is passed to {@link #listOfStructs(List)}.
- *
+ *
* @param listOfStructs
* a consumer that will call methods on
* {@link software.amazon.awssdk.services.jsonprotocoltests.model.SimpleStruct.Builder}
@@ -1963,7 +1993,7 @@ public interface Builder extends JsonProtocolTestsResponse.Builder, SdkPojo, Cop
*
* 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.
@@ -1971,7 +2001,7 @@ public interface Builder extends JsonProtocolTestsResponse.Builder, SdkPojo, Cop
*/
default Builder structWithNestedTimestampMember(Consumer structWithNestedTimestampMember) {
return structWithNestedTimestampMember(StructWithTimestamp.builder().applyMutation(structWithNestedTimestampMember)
- .build());
+ .build());
}
/**
@@ -2001,7 +2031,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.
@@ -2056,7 +2086,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.
@@ -2084,7 +2114,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.
@@ -2112,7 +2142,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.
@@ -2162,7 +2192,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.
@@ -2199,7 +2229,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.
@@ -2225,6 +2255,8 @@ static final class BuilderImpl extends JsonProtocolTestsResponse.BuilderImpl imp
private Short shortMember;
+ private Byte byteMember;
+
private List simpleList = DefaultSdkAutoConstructList.getInstance();
private List listOfEnums = DefaultSdkAutoConstructList.getInstance();
@@ -2293,6 +2325,7 @@ private BuilderImpl(AllTypesResponse model) {
doubleMember(model.doubleMember);
longMember(model.longMember);
shortMember(model.shortMember);
+ byteMember(model.byteMember);
simpleList(model.simpleList);
listOfEnumsWithStrings(model.listOfEnums);
listOfMaps(model.listOfMaps);
@@ -2421,6 +2454,20 @@ public final Builder shortMember(Short shortMember) {
return this;
}
+ public final Byte getByteMember() {
+ return byteMember;
+ }
+
+ public final void setByteMember(Byte byteMember) {
+ this.byteMember = byteMember;
+ }
+
+ @Override
+ public final Builder byteMember(Byte byteMember) {
+ this.byteMember = byteMember;
+ return this;
+ }
+
public final Collection getSimpleList() {
if (simpleList instanceof SdkAutoConstructList) {
return null;
@@ -2535,7 +2582,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;
}
@@ -2565,7 +2612,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;
}
@@ -2573,7 +2620,7 @@ public final List> getListOfMapOfStringToStruc
}
public final void setListOfMapOfStringToStruct(
- Collection extends Map> listOfMapOfStringToStruct) {
+ Collection extends Map> listOfMapOfStringToStruct) {
this.listOfMapOfStringToStruct = ListOfMapOfStringToStructCopier.copyFromBuilder(listOfMapOfStringToStruct);
}
@@ -2626,7 +2673,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;
}
@@ -2772,14 +2819,14 @@ public final void setMapOfEnumToMapOfStringToEnum(Map> mapOfEnumToMapOfStringToEnum) {
+ Map> mapOfEnumToMapOfStringToEnum) {
this.mapOfEnumToMapOfStringToEnum = MapOfEnumToMapOfStringToEnumCopier.copy(mapOfEnumToMapOfStringToEnum);
return this;
}
@Override
public final Builder mapOfEnumToMapOfStringToEnum(
- Map> mapOfEnumToMapOfStringToEnum) {
+ Map> mapOfEnumToMapOfStringToEnum) {
this.mapOfEnumToMapOfStringToEnum = MapOfEnumToMapOfStringToEnumCopier.copyEnumToString(mapOfEnumToMapOfStringToEnum);
return this;
}
@@ -2804,7 +2851,7 @@ public final StructWithTimestamp.Builder getStructWithNestedTimestampMember() {
public final void setStructWithNestedTimestampMember(StructWithTimestamp.BuilderImpl structWithNestedTimestampMember) {
this.structWithNestedTimestampMember = structWithNestedTimestampMember != null ? structWithNestedTimestampMember
- .build() : null;
+ .build() : null;
}
@Override
@@ -2846,12 +2893,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
@@ -2869,7 +2916,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
@@ -2919,7 +2966,7 @@ public final SubTypeOne.Builder getPolymorphicTypeWithoutSubTypes() {
public final void setPolymorphicTypeWithoutSubTypes(SubTypeOne.BuilderImpl polymorphicTypeWithoutSubTypes) {
this.polymorphicTypeWithoutSubTypes = polymorphicTypeWithoutSubTypes != null ? polymorphicTypeWithoutSubTypes.build()
- : null;
+ : null;
}
@Override
diff --git a/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/service-2.json b/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/service-2.json
index e846f69f04ed..6823581873a8 100644
--- a/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/service-2.json
+++ b/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/service-2.json
@@ -1,3 +1,4 @@
+
{
"version":"2.0",
"metadata":{
@@ -140,6 +141,7 @@
"DoubleMember":{"shape":"Double"},
"LongMember":{"shape":"Long"},
"ShortMember":{"shape":"Short"},
+ "ByteMember":{"shape":"Byte"},
"SimpleList":{"shape":"ListOfStrings"},
"ListOfEnums":{"shape":"ListOfEnums"},
"ListOfMaps":{"shape":"ListOfMapStringToString"},
@@ -341,6 +343,7 @@
},
"Long":{"type":"long"},
"Short":{"type":"short"},
+ "Byte":{"type":"byte"},
"MapOfStringToIntegerList":{
"type":"map",
"key":{"shape":"String"},
diff --git a/core/protocols/aws-json-protocol/src/main/java/software/amazon/awssdk/protocols/json/SdkJsonGenerator.java b/core/protocols/aws-json-protocol/src/main/java/software/amazon/awssdk/protocols/json/SdkJsonGenerator.java
index 228333bdf724..bfd819708b33 100644
--- a/core/protocols/aws-json-protocol/src/main/java/software/amazon/awssdk/protocols/json/SdkJsonGenerator.java
+++ b/core/protocols/aws-json-protocol/src/main/java/software/amazon/awssdk/protocols/json/SdkJsonGenerator.java
@@ -166,6 +166,16 @@ public StructuredJsonGenerator writeValue(float val) {
return this;
}
+ @Override
+ public StructuredJsonGenerator writeValue(byte val) {
+ try {
+ generator.writeNumber(val);
+ } catch (IOException e) {
+ throw new JsonGenerationException(e);
+ }
+ return this;
+ }
+
@Override
public StructuredJsonGenerator writeValue(short val) {
try {
diff --git a/core/protocols/aws-json-protocol/src/main/java/software/amazon/awssdk/protocols/json/StructuredJsonGenerator.java b/core/protocols/aws-json-protocol/src/main/java/software/amazon/awssdk/protocols/json/StructuredJsonGenerator.java
index 98b83699849c..5d84ed0a9906 100644
--- a/core/protocols/aws-json-protocol/src/main/java/software/amazon/awssdk/protocols/json/StructuredJsonGenerator.java
+++ b/core/protocols/aws-json-protocol/src/main/java/software/amazon/awssdk/protocols/json/StructuredJsonGenerator.java
@@ -157,6 +157,10 @@ public String getContentType() {
StructuredJsonGenerator writeValue(short val);
+ default StructuredJsonGenerator writeValue(byte val) {
+ return writeValue((short) val);
+ }
+
StructuredJsonGenerator writeValue(int val);
StructuredJsonGenerator writeValue(ByteBuffer bytes);
diff --git a/core/protocols/aws-json-protocol/src/main/java/software/amazon/awssdk/protocols/json/internal/marshall/HeaderMarshaller.java b/core/protocols/aws-json-protocol/src/main/java/software/amazon/awssdk/protocols/json/internal/marshall/HeaderMarshaller.java
index a3e3114a1628..110cdf36a11b 100644
--- a/core/protocols/aws-json-protocol/src/main/java/software/amazon/awssdk/protocols/json/internal/marshall/HeaderMarshaller.java
+++ b/core/protocols/aws-json-protocol/src/main/java/software/amazon/awssdk/protocols/json/internal/marshall/HeaderMarshaller.java
@@ -44,6 +44,8 @@ public final class HeaderMarshaller {
public static final JsonMarshaller SHORT = new SimpleHeaderMarshaller<>(ValueToStringConverter.FROM_SHORT);
+ public static final JsonMarshaller BYTE = new SimpleHeaderMarshaller<>(ValueToStringConverter.FROM_BYTE);
+
public static final JsonMarshaller DOUBLE = new SimpleHeaderMarshaller<>(ValueToStringConverter.FROM_DOUBLE);
public static final JsonMarshaller FLOAT = new SimpleHeaderMarshaller<>(ValueToStringConverter.FROM_FLOAT);
diff --git a/core/protocols/aws-json-protocol/src/main/java/software/amazon/awssdk/protocols/json/internal/marshall/JsonProtocolMarshaller.java b/core/protocols/aws-json-protocol/src/main/java/software/amazon/awssdk/protocols/json/internal/marshall/JsonProtocolMarshaller.java
index 92f34920d2c8..c0a3f46bff05 100644
--- a/core/protocols/aws-json-protocol/src/main/java/software/amazon/awssdk/protocols/json/internal/marshall/JsonProtocolMarshaller.java
+++ b/core/protocols/aws-json-protocol/src/main/java/software/amazon/awssdk/protocols/json/internal/marshall/JsonProtocolMarshaller.java
@@ -100,6 +100,7 @@ private static JsonMarshallerRegistry createMarshallerRegistry() {
.payloadMarshaller(MarshallingType.INTEGER, SimpleTypeJsonMarshaller.INTEGER)
.payloadMarshaller(MarshallingType.LONG, SimpleTypeJsonMarshaller.LONG)
.payloadMarshaller(MarshallingType.SHORT, SimpleTypeJsonMarshaller.SHORT)
+ .payloadMarshaller(MarshallingType.BYTE, SimpleTypeJsonMarshaller.BYTE)
.payloadMarshaller(MarshallingType.DOUBLE, SimpleTypeJsonMarshaller.DOUBLE)
.payloadMarshaller(MarshallingType.FLOAT, SimpleTypeJsonMarshaller.FLOAT)
.payloadMarshaller(MarshallingType.BIG_DECIMAL, SimpleTypeJsonMarshaller.BIG_DECIMAL)
@@ -116,6 +117,7 @@ private static JsonMarshallerRegistry createMarshallerRegistry() {
.headerMarshaller(MarshallingType.INTEGER, HeaderMarshaller.INTEGER)
.headerMarshaller(MarshallingType.LONG, HeaderMarshaller.LONG)
.headerMarshaller(MarshallingType.SHORT, HeaderMarshaller.SHORT)
+ .headerMarshaller(MarshallingType.BYTE, HeaderMarshaller.BYTE)
.headerMarshaller(MarshallingType.DOUBLE, HeaderMarshaller.DOUBLE)
.headerMarshaller(MarshallingType.FLOAT, HeaderMarshaller.FLOAT)
.headerMarshaller(MarshallingType.BOOLEAN, HeaderMarshaller.BOOLEAN)
@@ -127,6 +129,7 @@ private static JsonMarshallerRegistry createMarshallerRegistry() {
.queryParamMarshaller(MarshallingType.INTEGER, QueryParamMarshaller.INTEGER)
.queryParamMarshaller(MarshallingType.LONG, QueryParamMarshaller.LONG)
.queryParamMarshaller(MarshallingType.SHORT, QueryParamMarshaller.SHORT)
+ .queryParamMarshaller(MarshallingType.BYTE, QueryParamMarshaller.BYTE)
.queryParamMarshaller(MarshallingType.DOUBLE, QueryParamMarshaller.DOUBLE)
.queryParamMarshaller(MarshallingType.FLOAT, QueryParamMarshaller.FLOAT)
.queryParamMarshaller(MarshallingType.BOOLEAN, QueryParamMarshaller.BOOLEAN)
@@ -139,6 +142,7 @@ private static JsonMarshallerRegistry createMarshallerRegistry() {
.pathParamMarshaller(MarshallingType.INTEGER, SimpleTypePathMarshaller.INTEGER)
.pathParamMarshaller(MarshallingType.LONG, SimpleTypePathMarshaller.LONG)
.pathParamMarshaller(MarshallingType.SHORT, SimpleTypePathMarshaller.SHORT)
+ .pathParamMarshaller(MarshallingType.BYTE, SimpleTypePathMarshaller.BYTE)
.pathParamMarshaller(MarshallingType.NULL, SimpleTypePathMarshaller.NULL)
.greedyPathParamMarshaller(MarshallingType.STRING, SimpleTypePathMarshaller.GREEDY_STRING)
diff --git a/core/protocols/aws-json-protocol/src/main/java/software/amazon/awssdk/protocols/json/internal/marshall/QueryParamMarshaller.java b/core/protocols/aws-json-protocol/src/main/java/software/amazon/awssdk/protocols/json/internal/marshall/QueryParamMarshaller.java
index f2cb143d57b0..e6445670ab2a 100644
--- a/core/protocols/aws-json-protocol/src/main/java/software/amazon/awssdk/protocols/json/internal/marshall/QueryParamMarshaller.java
+++ b/core/protocols/aws-json-protocol/src/main/java/software/amazon/awssdk/protocols/json/internal/marshall/QueryParamMarshaller.java
@@ -38,6 +38,8 @@ public final class QueryParamMarshaller {
public static final JsonMarshaller SHORT = new SimpleQueryParamMarshaller<>(ValueToStringConverter.FROM_SHORT);
+ public static final JsonMarshaller BYTE = new SimpleQueryParamMarshaller<>(ValueToStringConverter.FROM_BYTE);
+
public static final JsonMarshaller DOUBLE = new SimpleQueryParamMarshaller<>(
ValueToStringConverter.FROM_DOUBLE);
diff --git a/core/protocols/aws-json-protocol/src/main/java/software/amazon/awssdk/protocols/json/internal/marshall/SimpleTypeJsonMarshaller.java b/core/protocols/aws-json-protocol/src/main/java/software/amazon/awssdk/protocols/json/internal/marshall/SimpleTypeJsonMarshaller.java
index d9979f84042a..a1eb5a77d4f3 100644
--- a/core/protocols/aws-json-protocol/src/main/java/software/amazon/awssdk/protocols/json/internal/marshall/SimpleTypeJsonMarshaller.java
+++ b/core/protocols/aws-json-protocol/src/main/java/software/amazon/awssdk/protocols/json/internal/marshall/SimpleTypeJsonMarshaller.java
@@ -82,6 +82,13 @@ public void marshall(Short val, StructuredJsonGenerator jsonGenerator, JsonMarsh
}
};
+ public static final JsonMarshaller BYTE = new BaseJsonMarshaller() {
+ @Override
+ public void marshall(Byte val, StructuredJsonGenerator jsonGenerator, JsonMarshallerContext context) {
+ jsonGenerator.writeValue(val);
+ }
+ };
+
public static final JsonMarshaller FLOAT = new BaseJsonMarshaller() {
@Override
public void marshall(Float val, StructuredJsonGenerator jsonGenerator, JsonMarshallerContext context) {
diff --git a/core/protocols/aws-json-protocol/src/main/java/software/amazon/awssdk/protocols/json/internal/marshall/SimpleTypePathMarshaller.java b/core/protocols/aws-json-protocol/src/main/java/software/amazon/awssdk/protocols/json/internal/marshall/SimpleTypePathMarshaller.java
index d653788a37ae..b2cc279b3f08 100644
--- a/core/protocols/aws-json-protocol/src/main/java/software/amazon/awssdk/protocols/json/internal/marshall/SimpleTypePathMarshaller.java
+++ b/core/protocols/aws-json-protocol/src/main/java/software/amazon/awssdk/protocols/json/internal/marshall/SimpleTypePathMarshaller.java
@@ -35,6 +35,9 @@ public final class SimpleTypePathMarshaller {
public static final JsonMarshaller SHORT =
new SimplePathMarshaller<>(ValueToStringConverter.FROM_SHORT, PathMarshaller.NON_GREEDY);
+ public static final JsonMarshaller BYTE =
+ new SimplePathMarshaller<>(ValueToStringConverter.FROM_BYTE, PathMarshaller.NON_GREEDY);
+
/**
* Marshallers for Strings bound to a greedy path param. No URL encoding is done on the string
* so that it preserves the path structure.
diff --git a/core/protocols/aws-json-protocol/src/main/java/software/amazon/awssdk/protocols/json/internal/unmarshall/JsonProtocolUnmarshaller.java b/core/protocols/aws-json-protocol/src/main/java/software/amazon/awssdk/protocols/json/internal/unmarshall/JsonProtocolUnmarshaller.java
index f067a8fbcd6f..e55a75797c91 100644
--- a/core/protocols/aws-json-protocol/src/main/java/software/amazon/awssdk/protocols/json/internal/unmarshall/JsonProtocolUnmarshaller.java
+++ b/core/protocols/aws-json-protocol/src/main/java/software/amazon/awssdk/protocols/json/internal/unmarshall/JsonProtocolUnmarshaller.java
@@ -88,6 +88,7 @@ private static JsonUnmarshallerRegistry createUnmarshallerRegistry(
.payloadUnmarshaller(MarshallingType.STRING, new SimpleTypeJsonUnmarshaller<>(StringToValueConverter.TO_STRING))
.payloadUnmarshaller(MarshallingType.INTEGER, new SimpleTypeJsonUnmarshaller<>(StringToValueConverter.TO_INTEGER))
.payloadUnmarshaller(MarshallingType.LONG, new SimpleTypeJsonUnmarshaller<>(StringToValueConverter.TO_LONG))
+ .payloadUnmarshaller(MarshallingType.BYTE, new SimpleTypeJsonUnmarshaller<>(StringToValueConverter.TO_BYTE))
.payloadUnmarshaller(MarshallingType.SHORT, new SimpleTypeJsonUnmarshaller<>(StringToValueConverter.TO_SHORT))
.payloadUnmarshaller(MarshallingType.FLOAT, new SimpleTypeJsonUnmarshaller<>(StringToValueConverter.TO_FLOAT))
.payloadUnmarshaller(MarshallingType.DOUBLE, new SimpleTypeJsonUnmarshaller<>(StringToValueConverter.TO_DOUBLE))
diff --git a/core/protocols/protocol-core/src/main/java/software/amazon/awssdk/protocols/core/StringToValueConverter.java b/core/protocols/protocol-core/src/main/java/software/amazon/awssdk/protocols/core/StringToValueConverter.java
index 251456f50d5f..2a3a58aaea95 100644
--- a/core/protocols/protocol-core/src/main/java/software/amazon/awssdk/protocols/core/StringToValueConverter.java
+++ b/core/protocols/protocol-core/src/main/java/software/amazon/awssdk/protocols/core/StringToValueConverter.java
@@ -76,6 +76,8 @@ default T convert(String s, SdkField sdkField) {
public static final SimpleStringToValue TO_LONG = Long::parseLong;
+ public static final SimpleStringToValue TO_BYTE = Byte::parseByte;
+
public static final SimpleStringToValue TO_SHORT = Short::parseShort;
public static final SimpleStringToValue TO_FLOAT = Float::parseFloat;
diff --git a/core/protocols/protocol-core/src/main/java/software/amazon/awssdk/protocols/core/ValueToStringConverter.java b/core/protocols/protocol-core/src/main/java/software/amazon/awssdk/protocols/core/ValueToStringConverter.java
index 508fbf618452..778b4016c920 100644
--- a/core/protocols/protocol-core/src/main/java/software/amazon/awssdk/protocols/core/ValueToStringConverter.java
+++ b/core/protocols/protocol-core/src/main/java/software/amazon/awssdk/protocols/core/ValueToStringConverter.java
@@ -78,6 +78,8 @@ default String convert(T t, SdkField field) {
public static final SimpleValueToString FROM_SHORT = Object::toString;
+ public static final SimpleValueToString FROM_BYTE = Object::toString;
+
public static final SimpleValueToString FROM_FLOAT = Object::toString;
public static final SimpleValueToString FROM_DOUBLE = Object::toString;
diff --git a/core/sdk-core/src/main/java/software/amazon/awssdk/core/protocol/MarshallingType.java b/core/sdk-core/src/main/java/software/amazon/awssdk/core/protocol/MarshallingType.java
index 8668b18a3814..ee345d6e8619 100644
--- a/core/sdk-core/src/main/java/software/amazon/awssdk/core/protocol/MarshallingType.java
+++ b/core/sdk-core/src/main/java/software/amazon/awssdk/core/protocol/MarshallingType.java
@@ -63,6 +63,8 @@ public interface MarshallingType {
MarshallingType SHORT = newType(Short.class);
+ MarshallingType BYTE = newType(Byte.class);
+
MarshallingType DOCUMENT = newType(Document.class);
Class super T> getTargetClass();
diff --git a/test/protocol-tests-core/src/main/java/software/amazon/awssdk/protocol/reflect/ShapeModelReflector.java b/test/protocol-tests-core/src/main/java/software/amazon/awssdk/protocol/reflect/ShapeModelReflector.java
index 9e503bf1c65f..377f7b4e0863 100644
--- a/test/protocol-tests-core/src/main/java/software/amazon/awssdk/protocol/reflect/ShapeModelReflector.java
+++ b/test/protocol-tests-core/src/main/java/software/amazon/awssdk/protocol/reflect/ShapeModelReflector.java
@@ -230,7 +230,9 @@ private Object getSimpleMemberValue(JsonNode currentNode, MemberModel memberMode
case "Long":
return currentNode.asLong();
case "Short":
- return (short) currentNode.asInt();
+ return (short) currentNode.asInt();
+ case "Byte":
+ return (byte) currentNode.asInt();
case "Integer":
return currentNode.asInt();
case "String":
diff --git a/test/protocol-tests-core/src/main/resources/software/amazon/awssdk/protocol/suites/cases/json-core-input.json b/test/protocol-tests-core/src/main/resources/software/amazon/awssdk/protocol/suites/cases/json-core-input.json
index b1815aa8ba66..032f77b856a8 100644
--- a/test/protocol-tests-core/src/main/resources/software/amazon/awssdk/protocol/suites/cases/json-core-input.json
+++ b/test/protocol-tests-core/src/main/resources/software/amazon/awssdk/protocol/suites/cases/json-core-input.json
@@ -10,7 +10,8 @@
"DoubleMember": 5.678,
"BigDecimalMember": 1177.61699999,
"LongMember": 2147483647,
- "ShortMember": 5
+ "ShortMember": 5,
+ "ByteMember": 127
}
},
"when": {
@@ -20,7 +21,7 @@
"then": {
"serializedAs": {
"body": {
- "jsonEquals": "{\"StringMember\":\"someVal\",\"IntegerMember\":42,\"FloatMember\":1.234,\"DoubleMember\":5.678,\"BigDecimalMember\":\"1177.61699999\",\"LongMember\":2147483647,\"ShortMember\":5}"
+ "jsonEquals": "{\"StringMember\":\"someVal\",\"IntegerMember\":42,\"FloatMember\":1.234,\"DoubleMember\":5.678,\"BigDecimalMember\":\"1177.61699999\",\"LongMember\":2147483647,\"ShortMember\":5,\"ByteMember\": 127}"
}
}
}
diff --git a/test/protocol-tests-core/src/main/resources/software/amazon/awssdk/protocol/suites/cases/json-core-output.json b/test/protocol-tests-core/src/main/resources/software/amazon/awssdk/protocol/suites/cases/json-core-output.json
index 807cde16ac3b..e1710a6b6f34 100644
--- a/test/protocol-tests-core/src/main/resources/software/amazon/awssdk/protocol/suites/cases/json-core-output.json
+++ b/test/protocol-tests-core/src/main/resources/software/amazon/awssdk/protocol/suites/cases/json-core-output.json
@@ -5,7 +5,7 @@
"given": {
"response": {
"status_code": 200,
- "body": "{\"StringMember\": \"myname\", \"IntegerMember\": 123, \"FloatMember\": 1.2, \"DoubleMember\": 1.3, \"LongMember\": 200,\"BigDecimalMember\":1177.61699999, \"ShortMember\":5}"
+ "body": "{\"StringMember\": \"myname\", \"IntegerMember\": 123, \"FloatMember\": 1.2, \"DoubleMember\": 1.3, \"LongMember\": 200,\"BigDecimalMember\":1177.61699999, \"ShortMember\":5, \"ByteMember\":127}"
}
},
"when": {
@@ -20,7 +20,8 @@
"DoubleMember": 1.3,
"LongMember": 200,
"BigDecimalMember": 1177.61699999,
- "ShortMember": 5
+ "ShortMember": 5,
+ "ByteMember": 127
}
}
},
diff --git a/test/protocol-tests/src/main/resources/codegen-resources/awsjson/service-2.json b/test/protocol-tests/src/main/resources/codegen-resources/awsjson/service-2.json
index 340dd2caa73b..804153e63e1c 100644
--- a/test/protocol-tests/src/main/resources/codegen-resources/awsjson/service-2.json
+++ b/test/protocol-tests/src/main/resources/codegen-resources/awsjson/service-2.json
@@ -73,6 +73,7 @@
"BigDecimalMember":{"shape":"NumericValue"},
"LongMember":{"shape":"Long"},
"ShortMember":{"shape":"Short"},
+ "ByteMember":{"shape":"Byte"},
"SimpleList":{"shape":"ListOfStrings"},
"ListOfMaps":{"shape":"ListOfMapStringToString"},
"ListOfStructs":{"shape":"ListOfSimpleStructs"},
@@ -127,6 +128,7 @@
},
"Float":{"type":"float"},
"Short":{"type":"short"},
+ "Byte":{"type":"byte"},
"FurtherNestedContainersStructure":{
"type":"structure",
"members":{
diff --git a/test/protocol-tests/src/main/resources/codegen-resources/restjson/service-2.json b/test/protocol-tests/src/main/resources/codegen-resources/restjson/service-2.json
index d43d40a565eb..144f38b9a771 100644
--- a/test/protocol-tests/src/main/resources/codegen-resources/restjson/service-2.json
+++ b/test/protocol-tests/src/main/resources/codegen-resources/restjson/service-2.json
@@ -259,6 +259,7 @@
"DoubleMember":{"shape":"Double"},
"LongMember":{"shape":"Long"},
"ShortMember":{"shape":"Short"},
+ "ByteMember":{"shape":"Byte"},
"BigDecimalMember":{"shape":"NumericValue"},
"SimpleList":{"shape":"ListOfStrings"},
"ListOfMaps":{"shape":"ListOfMapStringToString"},
@@ -494,6 +495,7 @@
},
"Long":{"type":"long"},
"Short":{"type":"short"},
+ "Byte":{"type":"byte"},
"MapOfEnumToEnum":{
"type":"map",
"key":{"shape":"EnumType"},
From 8b4378245f36bc7a5babace8d4837a08e1fe0051 Mon Sep 17 00:00:00 2001
From: Manuel Sugawara
Date: Thu, 15 Aug 2024 13:48:14 -0700
Subject: [PATCH 06/18] Add rpcv2 protocol core (#5496)
* Add support to serialize byte values
* Add RPCv2 protocol core marshalling/unmarshalling
* Address PR comments
* Address PR comments 2
* Address PR comments 3
---
codegen/pom.xml | 2 -
.../DefaultCustomizationProcessor.java | 1 +
.../SmithyRpcV2CborProtocolProcessor.java | 53 ++
.../amazon/awssdk/codegen/internal/Utils.java | 15 +-
.../codegen/model/intermediate/Metadata.java | 12 +-
.../codegen/model/intermediate/Protocol.java | 3 +-
.../model/intermediate/ShapeMarshaller.java | 15 +
.../codegen/poet/client/SyncClientClass.java | 1 +
.../poet/client/specs/JsonProtocolSpec.java | 3 +
.../poet/transform/MarshallerSpec.java | 1 +
.../protocols/JsonMarshallerSpec.java | 8 +
.../awscore/internal/AwsServiceProtocol.java | 1 +
.../protocols/json/AwsJsonProtocol.java | 5 +
.../json/BaseAwsJsonProtocolFactory.java | 5 +-
.../json/StructuredJsonGenerator.java | 4 +
.../marshall/JsonProtocolMarshaller.java | 21 +-
.../marshall/SimpleTypeJsonMarshaller.java | 2 +-
.../core/OperationMetadataAttribute.java | 6 +
core/protocols/smithy-rpcv2-protocol/pom.xml | 2 -
.../rpcv2/SmithyRpcV2CborProtocolFactory.java | 100 +++
.../rpcv2/internal/SdkRpcV2CborGenerator.java | 117 +++
.../SdkStructuredRpcV2CborFactory.java | 55 ++
.../internal/SdkRpcV2CborGeneratorTest.java | 217 ++++++
.../marshalling/EncodedBodyAssertion.java | 40 ++
.../marshalling/RequestBodyAssertion.java | 4 +
.../awssdk/protocol/model/GivenResponse.java | 9 +
.../runners/UnmarshallingTestRunner.java | 3 +
.../suites/cases/smithy-rpcv2-input.json | 560 +++++++++++++++
.../suites/cases/smithy-rpcv2-output.json | 667 ++++++++++++++++++
.../protocol/suites/smithy-rpcv2-suite.json | 6 +
test/protocol-tests/pom.xml | 2 -
.../rpcv2/customization.config | 3 +
.../rpcv2/endpoint-rule-set.json | 59 ++
.../rpcv2/endpoint-tests.json | 5 +
.../codegen-resources/rpcv2/service-2.json | 546 ++++++++++++++
.../tests/SmithyRpcV2CborProtocolTest.java | 51 ++
36 files changed, 2583 insertions(+), 21 deletions(-)
create mode 100644 codegen/src/main/java/software/amazon/awssdk/codegen/customization/processors/SmithyRpcV2CborProtocolProcessor.java
create mode 100644 core/protocols/smithy-rpcv2-protocol/src/main/java/software/amazon/awssdk/protocols/rpcv2/SmithyRpcV2CborProtocolFactory.java
create mode 100644 core/protocols/smithy-rpcv2-protocol/src/main/java/software/amazon/awssdk/protocols/rpcv2/internal/SdkRpcV2CborGenerator.java
create mode 100644 core/protocols/smithy-rpcv2-protocol/src/main/java/software/amazon/awssdk/protocols/rpcv2/internal/SdkStructuredRpcV2CborFactory.java
create mode 100644 core/protocols/smithy-rpcv2-protocol/src/test/java/software/amazon/awssdk/protocols/rpcv2/internal/SdkRpcV2CborGeneratorTest.java
create mode 100644 test/protocol-tests-core/src/main/java/software/amazon/awssdk/protocol/asserts/marshalling/EncodedBodyAssertion.java
create mode 100644 test/protocol-tests-core/src/main/resources/software/amazon/awssdk/protocol/suites/cases/smithy-rpcv2-input.json
create mode 100644 test/protocol-tests-core/src/main/resources/software/amazon/awssdk/protocol/suites/cases/smithy-rpcv2-output.json
create mode 100644 test/protocol-tests-core/src/main/resources/software/amazon/awssdk/protocol/suites/smithy-rpcv2-suite.json
create mode 100644 test/protocol-tests/src/main/resources/codegen-resources/rpcv2/customization.config
create mode 100644 test/protocol-tests/src/main/resources/codegen-resources/rpcv2/endpoint-rule-set.json
create mode 100644 test/protocol-tests/src/main/resources/codegen-resources/rpcv2/endpoint-tests.json
create mode 100644 test/protocol-tests/src/main/resources/codegen-resources/rpcv2/service-2.json
create mode 100644 test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/SmithyRpcV2CborProtocolTest.java
diff --git a/codegen/pom.xml b/codegen/pom.xml
index 0270787125c4..ffc2870fe13d 100644
--- a/codegen/pom.xml
+++ b/codegen/pom.xml
@@ -142,13 +142,11 @@
aws-xml-protocol${awsjavasdk.version}
-
software.amazon.awssdkprotocol-core
diff --git a/codegen/src/main/java/software/amazon/awssdk/codegen/customization/processors/DefaultCustomizationProcessor.java b/codegen/src/main/java/software/amazon/awssdk/codegen/customization/processors/DefaultCustomizationProcessor.java
index d8a61167a7d8..bfdf58fc8045 100644
--- a/codegen/src/main/java/software/amazon/awssdk/codegen/customization/processors/DefaultCustomizationProcessor.java
+++ b/codegen/src/main/java/software/amazon/awssdk/codegen/customization/processors/DefaultCustomizationProcessor.java
@@ -34,6 +34,7 @@ public static CodegenCustomizationProcessor getProcessorFor(
new ShapeSubstitutionsProcessor(config.getShapeSubstitutions()),
new CustomSdkShapesProcessor(config.getCustomSdkShapes()),
new OperationModifiersProcessor(config.getOperationModifiers()),
+ new SmithyRpcV2CborProtocolProcessor(),
new RemoveExceptionMessagePropertyProcessor(),
new UseLegacyEventGenerationSchemeProcessor(),
new NewAndLegacyEventStreamProcessor(),
diff --git a/codegen/src/main/java/software/amazon/awssdk/codegen/customization/processors/SmithyRpcV2CborProtocolProcessor.java b/codegen/src/main/java/software/amazon/awssdk/codegen/customization/processors/SmithyRpcV2CborProtocolProcessor.java
new file mode 100644
index 000000000000..d4921a6d4822
--- /dev/null
+++ b/codegen/src/main/java/software/amazon/awssdk/codegen/customization/processors/SmithyRpcV2CborProtocolProcessor.java
@@ -0,0 +1,53 @@
+/*
+ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://aws.amazon.com/apache2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package software.amazon.awssdk.codegen.customization.processors;
+
+import software.amazon.awssdk.codegen.customization.CodegenCustomizationProcessor;
+import software.amazon.awssdk.codegen.model.intermediate.IntermediateModel;
+import software.amazon.awssdk.codegen.model.service.Http;
+import software.amazon.awssdk.codegen.model.service.Operation;
+import software.amazon.awssdk.codegen.model.service.ServiceModel;
+import software.amazon.awssdk.utils.StringUtils;
+
+/**
+ * This processor only runs for services using the smithy-rpc-v2-cbor protocol.
+ *
+ * Adds a request URI that conform to the Smithy RPCv2 protocol to each operation in the model, if there's no URI already
+ * defined.
+ */
+public class SmithyRpcV2CborProtocolProcessor implements CodegenCustomizationProcessor {
+ @Override
+ public void preprocess(ServiceModel serviceModel) {
+ if (!"smithy-rpc-v2-cbor".equals(serviceModel.getMetadata().getProtocol())) {
+ return;
+ }
+ serviceModel.getOperations().forEach((name, op) -> setRequestUri(serviceModel, name, op));
+ }
+
+ private void setRequestUri(ServiceModel service, String name, Operation op) {
+ Http http = op.getHttp();
+ String requestUri = http.getRequestUri();
+ if (StringUtils.isNotBlank(requestUri) && !"/".equals(requestUri)) {
+ return;
+ }
+ String uri = String.format("/service/%s/operation/%s", service.getMetadata().getTargetPrefix(), op.getName());
+ op.getHttp().setRequestUri(uri);
+ }
+
+ @Override
+ public void postprocess(IntermediateModel intermediateModel) {
+ }
+}
diff --git a/codegen/src/main/java/software/amazon/awssdk/codegen/internal/Utils.java b/codegen/src/main/java/software/amazon/awssdk/codegen/internal/Utils.java
index 13703cbb61da..9184d096d55b 100644
--- a/codegen/src/main/java/software/amazon/awssdk/codegen/internal/Utils.java
+++ b/codegen/src/main/java/software/amazon/awssdk/codegen/internal/Utils.java
@@ -29,6 +29,7 @@
import software.amazon.awssdk.codegen.model.intermediate.MapModel;
import software.amazon.awssdk.codegen.model.intermediate.MemberModel;
import software.amazon.awssdk.codegen.model.intermediate.Metadata;
+import software.amazon.awssdk.codegen.model.intermediate.Protocol;
import software.amazon.awssdk.codegen.model.intermediate.ShapeMarshaller;
import software.amazon.awssdk.codegen.model.intermediate.ShapeModel;
import software.amazon.awssdk.codegen.model.intermediate.ShapeType;
@@ -333,7 +334,8 @@ public static ShapeMarshaller createInputShapeMarshaller(ServiceMetadata service
ShapeMarshaller marshaller = new ShapeMarshaller()
.withAction(operation.getName())
.withVerb(operation.getHttp().getMethod())
- .withRequestUri(operation.getHttp().getRequestUri());
+ .withRequestUri(operation.getHttp().getRequestUri())
+ .withSmithyProtocol(getSmithyProtocol(service.getProtocol()));
Input input = operation.getInput();
if (input != null) {
marshaller.setLocationName(input.getLocationName());
@@ -343,7 +345,7 @@ public static ShapeMarshaller createInputShapeMarshaller(ServiceMetadata service
marshaller.setXmlNameSpaceUri(xmlNamespace.getUri());
}
}
- if (Metadata.isNotRestProtocol(service.getProtocol())) {
+ if (Metadata.usesOperationIdentifier(service.getProtocol())) {
marshaller.setTarget(StringUtils.isEmpty(service.getTargetPrefix()) ?
operation.getName() :
service.getTargetPrefix() + "." + operation.getName());
@@ -351,4 +353,13 @@ public static ShapeMarshaller createInputShapeMarshaller(ServiceMetadata service
return marshaller;
}
+
+ private static String getSmithyProtocol(String protocol) {
+ switch (Protocol.fromValue(protocol)) {
+ case SMITHY_RPC_V2_CBOR:
+ return "rpc-v2-cbor";
+ default:
+ return null;
+ }
+ }
}
diff --git a/codegen/src/main/java/software/amazon/awssdk/codegen/model/intermediate/Metadata.java b/codegen/src/main/java/software/amazon/awssdk/codegen/model/intermediate/Metadata.java
index ada732afdb2d..bdd2c36ac2d3 100644
--- a/codegen/src/main/java/software/amazon/awssdk/codegen/model/intermediate/Metadata.java
+++ b/codegen/src/main/java/software/amazon/awssdk/codegen/model/intermediate/Metadata.java
@@ -545,8 +545,13 @@ public boolean isCborProtocol() {
return protocol == Protocol.CBOR;
}
+ public boolean isRpcV2CborProtocol() {
+ return protocol == Protocol.SMITHY_RPC_V2_CBOR;
+ }
+
public boolean isJsonProtocol() {
- return protocol == Protocol.CBOR ||
+ return protocol == Protocol.SMITHY_RPC_V2_CBOR ||
+ protocol == Protocol.CBOR ||
protocol == Protocol.AWS_JSON ||
protocol == Protocol.REST_JSON;
}
@@ -563,12 +568,13 @@ public boolean isQueryProtocol() {
}
/**
- * @return True for RESTful protocols. False for all other protocols (RPC, Query, etc).
+ * @return True for protocols that require an operation identifier to be sent in the `X-Amz-Target` header.
*/
- public static boolean isNotRestProtocol(String protocol) {
+ public static boolean usesOperationIdentifier(String protocol) {
switch (Protocol.fromValue(protocol)) {
case REST_JSON:
case REST_XML:
+ case SMITHY_RPC_V2_CBOR:
return false;
default:
return true;
diff --git a/codegen/src/main/java/software/amazon/awssdk/codegen/model/intermediate/Protocol.java b/codegen/src/main/java/software/amazon/awssdk/codegen/model/intermediate/Protocol.java
index 719d088c77e2..545a1add99f3 100644
--- a/codegen/src/main/java/software/amazon/awssdk/codegen/model/intermediate/Protocol.java
+++ b/codegen/src/main/java/software/amazon/awssdk/codegen/model/intermediate/Protocol.java
@@ -24,7 +24,8 @@ public enum Protocol {
REST_JSON("rest-json"),
CBOR("cbor"),
QUERY("query"),
- REST_XML("rest-xml");
+ REST_XML("rest-xml"),
+ SMITHY_RPC_V2_CBOR("smithy-rpc-v2-cbor");
private String protocol;
diff --git a/codegen/src/main/java/software/amazon/awssdk/codegen/model/intermediate/ShapeMarshaller.java b/codegen/src/main/java/software/amazon/awssdk/codegen/model/intermediate/ShapeMarshaller.java
index eae9a1b77758..18d8d735908f 100644
--- a/codegen/src/main/java/software/amazon/awssdk/codegen/model/intermediate/ShapeMarshaller.java
+++ b/codegen/src/main/java/software/amazon/awssdk/codegen/model/intermediate/ShapeMarshaller.java
@@ -29,6 +29,8 @@ public class ShapeMarshaller {
private String xmlNameSpaceUri;
+ private String smithyProtocol;
+
public String getAction() {
return action;
}
@@ -106,4 +108,17 @@ public ShapeMarshaller withXmlNameSpaceUri(String xmlNameSpaceUri) {
setXmlNameSpaceUri(xmlNameSpaceUri);
return this;
}
+
+ public String getSmithyProtocol() {
+ return smithyProtocol;
+ }
+
+ public void setSmithyProtocol(String smithyProtocol) {
+ this.smithyProtocol = smithyProtocol;
+ }
+
+ public ShapeMarshaller withSmithyProtocol(String smithyProtocol) {
+ setSmithyProtocol(smithyProtocol);
+ return this;
+ }
}
diff --git a/codegen/src/main/java/software/amazon/awssdk/codegen/poet/client/SyncClientClass.java b/codegen/src/main/java/software/amazon/awssdk/codegen/poet/client/SyncClientClass.java
index befb4b49bc28..71585ad21db5 100644
--- a/codegen/src/main/java/software/amazon/awssdk/codegen/poet/client/SyncClientClass.java
+++ b/codegen/src/main/java/software/amazon/awssdk/codegen/poet/client/SyncClientClass.java
@@ -405,6 +405,7 @@ static ProtocolSpec getProtocolSpecs(PoetExtension poetExtensions, IntermediateM
case AWS_JSON:
case REST_JSON:
case CBOR:
+ case SMITHY_RPC_V2_CBOR:
return new JsonProtocolSpec(poetExtensions, model);
default:
throw new RuntimeException("Unknown protocol: " + protocol.name());
diff --git a/codegen/src/main/java/software/amazon/awssdk/codegen/poet/client/specs/JsonProtocolSpec.java b/codegen/src/main/java/software/amazon/awssdk/codegen/poet/client/specs/JsonProtocolSpec.java
index dc4a59f92ff7..6d2e174833ae 100644
--- a/codegen/src/main/java/software/amazon/awssdk/codegen/poet/client/specs/JsonProtocolSpec.java
+++ b/codegen/src/main/java/software/amazon/awssdk/codegen/poet/client/specs/JsonProtocolSpec.java
@@ -59,6 +59,7 @@
import software.amazon.awssdk.protocols.json.AwsJsonProtocolFactory;
import software.amazon.awssdk.protocols.json.BaseAwsJsonProtocolFactory;
import software.amazon.awssdk.protocols.json.JsonOperationMetadata;
+import software.amazon.awssdk.protocols.rpcv2.SmithyRpcV2CborProtocolFactory;
import software.amazon.awssdk.utils.CompletableFutureUtils;
public class JsonProtocolSpec implements ProtocolSpec {
@@ -131,6 +132,8 @@ private CodeBlock hasAwsQueryCompatible() {
private Class> protocolFactoryClass() {
if (model.getMetadata().isCborProtocol()) {
return AwsCborProtocolFactory.class;
+ } else if (model.getMetadata().isRpcV2CborProtocol()) {
+ return SmithyRpcV2CborProtocolFactory.class;
} else {
return AwsJsonProtocolFactory.class;
}
diff --git a/codegen/src/main/java/software/amazon/awssdk/codegen/poet/transform/MarshallerSpec.java b/codegen/src/main/java/software/amazon/awssdk/codegen/poet/transform/MarshallerSpec.java
index 0f2a3229e658..0391892ec427 100644
--- a/codegen/src/main/java/software/amazon/awssdk/codegen/poet/transform/MarshallerSpec.java
+++ b/codegen/src/main/java/software/amazon/awssdk/codegen/poet/transform/MarshallerSpec.java
@@ -115,6 +115,7 @@ private MethodSpec marshallMethod() {
private MarshallerProtocolSpec getProtocolSpecs(software.amazon.awssdk.codegen.model.intermediate.Protocol protocol) {
switch (protocol) {
+ case SMITHY_RPC_V2_CBOR:
case REST_JSON:
case CBOR:
case AWS_JSON:
diff --git a/codegen/src/main/java/software/amazon/awssdk/codegen/poet/transform/protocols/JsonMarshallerSpec.java b/codegen/src/main/java/software/amazon/awssdk/codegen/poet/transform/protocols/JsonMarshallerSpec.java
index eaed3ee87135..c92ed28f67c6 100644
--- a/codegen/src/main/java/software/amazon/awssdk/codegen/poet/transform/protocols/JsonMarshallerSpec.java
+++ b/codegen/src/main/java/software/amazon/awssdk/codegen/poet/transform/protocols/JsonMarshallerSpec.java
@@ -30,6 +30,7 @@
import software.amazon.awssdk.http.SdkHttpFullRequest;
import software.amazon.awssdk.http.SdkHttpMethod;
import software.amazon.awssdk.protocols.core.OperationInfo;
+import software.amazon.awssdk.protocols.core.OperationMetadataAttribute;
import software.amazon.awssdk.protocols.core.ProtocolMarshaller;
import software.amazon.awssdk.protocols.json.BaseAwsJsonProtocolFactory;
import software.amazon.awssdk.utils.StringUtils;
@@ -102,6 +103,13 @@ protected FieldSpec operationInfoField() {
initializationCodeBlockBuilder.add(".operationIdentifier($S)", shapeModel.getMarshaller().getTarget());
}
+ String smithyProtocol = shapeModel.getMarshaller().getSmithyProtocol();
+ if (StringUtils.isNotBlank(smithyProtocol)) {
+ initializationCodeBlockBuilder.add(".putAdditionalMetadata($T.SMITHY_PROTOCOL, $S)",
+ OperationMetadataAttribute.class, smithyProtocol);
+ }
+
+
if (shapeModel.isHasStreamingMember()) {
initializationCodeBlockBuilder.add(".hasStreamingInput(true)");
}
diff --git a/core/aws-core/src/main/java/software/amazon/awssdk/awscore/internal/AwsServiceProtocol.java b/core/aws-core/src/main/java/software/amazon/awssdk/awscore/internal/AwsServiceProtocol.java
index 7f0522413572..8b2ebe354a34 100644
--- a/core/aws-core/src/main/java/software/amazon/awssdk/awscore/internal/AwsServiceProtocol.java
+++ b/core/aws-core/src/main/java/software/amazon/awssdk/awscore/internal/AwsServiceProtocol.java
@@ -23,6 +23,7 @@ public enum AwsServiceProtocol {
AWS_JSON("json"),
REST_JSON("rest-json"),
CBOR("cbor"),
+ SMITHY_RPC_V2_CBOR("smithy-rpc-v2-cbor"),
QUERY("query"),
REST_XML("rest-xml");
diff --git a/core/protocols/aws-json-protocol/src/main/java/software/amazon/awssdk/protocols/json/AwsJsonProtocol.java b/core/protocols/aws-json-protocol/src/main/java/software/amazon/awssdk/protocols/json/AwsJsonProtocol.java
index 98f923f0f114..656642e3fd16 100644
--- a/core/protocols/aws-json-protocol/src/main/java/software/amazon/awssdk/protocols/json/AwsJsonProtocol.java
+++ b/core/protocols/aws-json-protocol/src/main/java/software/amazon/awssdk/protocols/json/AwsJsonProtocol.java
@@ -34,4 +34,9 @@ public enum AwsJsonProtocol {
* binary and streaming data. Operation is identified by HTTP verb and resource path combination.
*/
REST_JSON,
+
+ /**
+ * RPC protocol that sends all data in the payload as CBOR encoded JSON.
+ */
+ SMITHY_RPC_V2_CBOR,
}
diff --git a/core/protocols/aws-json-protocol/src/main/java/software/amazon/awssdk/protocols/json/BaseAwsJsonProtocolFactory.java b/core/protocols/aws-json-protocol/src/main/java/software/amazon/awssdk/protocols/json/BaseAwsJsonProtocolFactory.java
index 2fa813a5a330..0da4b4f3e902 100644
--- a/core/protocols/aws-json-protocol/src/main/java/software/amazon/awssdk/protocols/json/BaseAwsJsonProtocolFactory.java
+++ b/core/protocols/aws-json-protocol/src/main/java/software/amazon/awssdk/protocols/json/BaseAwsJsonProtocolFactory.java
@@ -138,7 +138,10 @@ private MetricCollectingHttpResponseHandler timeUnmarshalling(HttpRespons
}
private StructuredJsonGenerator createGenerator(OperationInfo operationInfo) {
- if (operationInfo.hasPayloadMembers() || protocolMetadata.protocol() == AwsJsonProtocol.AWS_JSON) {
+ AwsJsonProtocol protocol = protocolMetadata.protocol();
+ if (operationInfo.hasPayloadMembers()
+ || protocol == AwsJsonProtocol.AWS_JSON
+ || protocol == AwsJsonProtocol.SMITHY_RPC_V2_CBOR) {
return createGenerator();
} else {
return StructuredJsonGenerator.NO_OP;
diff --git a/core/protocols/aws-json-protocol/src/main/java/software/amazon/awssdk/protocols/json/StructuredJsonGenerator.java b/core/protocols/aws-json-protocol/src/main/java/software/amazon/awssdk/protocols/json/StructuredJsonGenerator.java
index 5d84ed0a9906..8d02b2ea78f8 100644
--- a/core/protocols/aws-json-protocol/src/main/java/software/amazon/awssdk/protocols/json/StructuredJsonGenerator.java
+++ b/core/protocols/aws-json-protocol/src/main/java/software/amazon/awssdk/protocols/json/StructuredJsonGenerator.java
@@ -135,6 +135,10 @@ public String getContentType() {
StructuredJsonGenerator writeStartArray();
+ default StructuredJsonGenerator writeStartArray(int size) {
+ return writeStartArray();
+ }
+
StructuredJsonGenerator writeEndArray();
StructuredJsonGenerator writeNull();
diff --git a/core/protocols/aws-json-protocol/src/main/java/software/amazon/awssdk/protocols/json/internal/marshall/JsonProtocolMarshaller.java b/core/protocols/aws-json-protocol/src/main/java/software/amazon/awssdk/protocols/json/internal/marshall/JsonProtocolMarshaller.java
index c0a3f46bff05..dc5f56e7ffbb 100644
--- a/core/protocols/aws-json-protocol/src/main/java/software/amazon/awssdk/protocols/json/internal/marshall/JsonProtocolMarshaller.java
+++ b/core/protocols/aws-json-protocol/src/main/java/software/amazon/awssdk/protocols/json/internal/marshall/JsonProtocolMarshaller.java
@@ -39,6 +39,7 @@
import software.amazon.awssdk.http.SdkHttpFullRequest;
import software.amazon.awssdk.protocols.core.InstantToString;
import software.amazon.awssdk.protocols.core.OperationInfo;
+import software.amazon.awssdk.protocols.core.OperationMetadataAttribute;
import software.amazon.awssdk.protocols.core.ProtocolMarshaller;
import software.amazon.awssdk.protocols.core.ProtocolUtils;
import software.amazon.awssdk.protocols.core.ValueToStringConverter.ValueToString;
@@ -161,12 +162,16 @@ private static Map getDefaultTime
}
private SdkHttpFullRequest.Builder fillBasicRequestParams(OperationInfo operationInfo) {
- return ProtocolUtils.createSdkHttpRequest(operationInfo, endpoint)
- .applyMutation(b -> {
- if (operationInfo.operationIdentifier() != null) {
- b.putHeader("X-Amz-Target", operationInfo.operationIdentifier());
- }
- });
+ SdkHttpFullRequest.Builder requestBuilder = ProtocolUtils.createSdkHttpRequest(operationInfo, endpoint);
+ String operationIdentifier = operationInfo.operationIdentifier();
+ if (operationIdentifier != null) {
+ requestBuilder.putHeader("X-Amz-Target", operationIdentifier);
+ }
+ String smithyProtocol = operationInfo.addtionalMetadata(OperationMetadataAttribute.SMITHY_PROTOCOL);
+ if (smithyProtocol != null) {
+ requestBuilder.putHeader("smithy-protocol", smithyProtocol);
+ }
+ return requestBuilder;
}
/**
@@ -290,7 +295,9 @@ private void marshallField(SdkField> field, Object val) {
}
private boolean needTopLevelJsonObject() {
- return AwsJsonProtocol.AWS_JSON.equals(protocolMetadata.protocol())
+ AwsJsonProtocol protocol = protocolMetadata.protocol();
+ return protocol == AwsJsonProtocol.AWS_JSON
+ || protocol == AwsJsonProtocol.SMITHY_RPC_V2_CBOR
|| (!hasExplicitPayloadMember && hasImplicitPayloadMembers);
}
diff --git a/core/protocols/aws-json-protocol/src/main/java/software/amazon/awssdk/protocols/json/internal/marshall/SimpleTypeJsonMarshaller.java b/core/protocols/aws-json-protocol/src/main/java/software/amazon/awssdk/protocols/json/internal/marshall/SimpleTypeJsonMarshaller.java
index a1eb5a77d4f3..c4c5da8a74e1 100644
--- a/core/protocols/aws-json-protocol/src/main/java/software/amazon/awssdk/protocols/json/internal/marshall/SimpleTypeJsonMarshaller.java
+++ b/core/protocols/aws-json-protocol/src/main/java/software/amazon/awssdk/protocols/json/internal/marshall/SimpleTypeJsonMarshaller.java
@@ -165,7 +165,7 @@ public void marshall(SdkPojo val, StructuredJsonGenerator jsonGenerator, JsonMar
public static final JsonMarshaller> LIST = new BaseJsonMarshaller>() {
@Override
public void marshall(List> list, StructuredJsonGenerator jsonGenerator, JsonMarshallerContext context) {
- jsonGenerator.writeStartArray();
+ jsonGenerator.writeStartArray(list.size());
for (Object listValue : list) {
context.marshall(MarshallLocation.PAYLOAD, listValue);
}
diff --git a/core/protocols/protocol-core/src/main/java/software/amazon/awssdk/protocols/core/OperationMetadataAttribute.java b/core/protocols/protocol-core/src/main/java/software/amazon/awssdk/protocols/core/OperationMetadataAttribute.java
index f77f084339b3..b2a6e587dcdb 100644
--- a/core/protocols/protocol-core/src/main/java/software/amazon/awssdk/protocols/core/OperationMetadataAttribute.java
+++ b/core/protocols/protocol-core/src/main/java/software/amazon/awssdk/protocols/core/OperationMetadataAttribute.java
@@ -27,6 +27,12 @@
@SdkProtectedApi
public final class OperationMetadataAttribute extends AttributeMap.Key {
+ /**
+ * Attribute for configuring the smithy-protocol header.
+ */
+ public static final OperationMetadataAttribute SMITHY_PROTOCOL =
+ new OperationMetadataAttribute<>(String.class);
+
public OperationMetadataAttribute(Class valueType) {
super(valueType);
}
diff --git a/core/protocols/smithy-rpcv2-protocol/pom.xml b/core/protocols/smithy-rpcv2-protocol/pom.xml
index 8dde8b80902c..3daf142e8f33 100644
--- a/core/protocols/smithy-rpcv2-protocol/pom.xml
+++ b/core/protocols/smithy-rpcv2-protocol/pom.xml
@@ -31,7 +31,6 @@
https://aws.amazon.com/sdkforjava
-
diff --git a/core/protocols/smithy-rpcv2-protocol/src/main/java/software/amazon/awssdk/protocols/rpcv2/SmithyRpcV2CborProtocolFactory.java b/core/protocols/smithy-rpcv2-protocol/src/main/java/software/amazon/awssdk/protocols/rpcv2/SmithyRpcV2CborProtocolFactory.java
new file mode 100644
index 000000000000..e3b76bdba065
--- /dev/null
+++ b/core/protocols/smithy-rpcv2-protocol/src/main/java/software/amazon/awssdk/protocols/rpcv2/SmithyRpcV2CborProtocolFactory.java
@@ -0,0 +1,100 @@
+/*
+ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://aws.amazon.com/apache2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package software.amazon.awssdk.protocols.rpcv2;
+
+import java.util.Collections;
+import java.util.EnumMap;
+import java.util.Map;
+import software.amazon.awssdk.annotations.SdkProtectedApi;
+import software.amazon.awssdk.core.protocol.MarshallLocation;
+import software.amazon.awssdk.core.traits.TimestampFormatTrait;
+import software.amazon.awssdk.protocols.json.BaseAwsJsonProtocolFactory;
+import software.amazon.awssdk.protocols.json.JsonContentTypeResolver;
+import software.amazon.awssdk.protocols.json.StructuredJsonFactory;
+import software.amazon.awssdk.protocols.rpcv2.internal.SdkStructuredRpcV2CborFactory;
+
+/**
+ * Protocol factory for RPCv2 CBOR protocol.
+ */
+@SdkProtectedApi
+public final class SmithyRpcV2CborProtocolFactory extends BaseAwsJsonProtocolFactory {
+
+ /**
+ * Content type resolver implementation for RPC_V2_CBOR enabled services.
+ */
+ private static final JsonContentTypeResolver RPC_V2_CBOR = protocolMetadata -> "application/cbor";
+
+ private SmithyRpcV2CborProtocolFactory(Builder builder) {
+ super(builder);
+ }
+
+ /**
+ * @return Content type resolver implementation to use.
+ */
+ @Override
+ protected JsonContentTypeResolver getContentTypeResolver() {
+ return RPC_V2_CBOR;
+ }
+
+ /**
+ * @return Instance of {@link StructuredJsonFactory} to use in creating handlers.
+ */
+ @Override
+ protected StructuredJsonFactory getSdkFactory() {
+ return SdkStructuredRpcV2CborFactory.SDK_CBOR_FACTORY;
+ }
+
+ /**
+ * Smithy RPCv2 uses epoch seconds with millisecond decimal precision.
+ */
+ @Override
+ protected Map getDefaultTimestampFormats() {
+ return LazyHolder.DEFAULT_TIMESTAMP_FORMATS;
+ }
+
+ public static Builder builder() {
+ return new Builder();
+ }
+
+ /**
+ * Builder for {@link SmithyRpcV2CborProtocolFactory}.
+ */
+ public static final class Builder extends BaseAwsJsonProtocolFactory.Builder {
+
+ private Builder() {
+ }
+
+ public SmithyRpcV2CborProtocolFactory build() {
+ return new SmithyRpcV2CborProtocolFactory(this);
+ }
+ }
+
+ // Lazy initialization holder class idiom
+ private static class LazyHolder {
+ private static final Map DEFAULT_TIMESTAMP_FORMATS =
+ createDefaultTimestampFormats();
+
+ private LazyHolder() {
+ }
+
+ static Map createDefaultTimestampFormats() {
+ Map formats = new EnumMap<>(MarshallLocation.class);
+ formats.put(MarshallLocation.PAYLOAD, TimestampFormatTrait.Format.UNIX_TIMESTAMP);
+ return Collections.unmodifiableMap(formats);
+
+ }
+ }
+}
diff --git a/core/protocols/smithy-rpcv2-protocol/src/main/java/software/amazon/awssdk/protocols/rpcv2/internal/SdkRpcV2CborGenerator.java b/core/protocols/smithy-rpcv2-protocol/src/main/java/software/amazon/awssdk/protocols/rpcv2/internal/SdkRpcV2CborGenerator.java
new file mode 100644
index 000000000000..b7423770bd1b
--- /dev/null
+++ b/core/protocols/smithy-rpcv2-protocol/src/main/java/software/amazon/awssdk/protocols/rpcv2/internal/SdkRpcV2CborGenerator.java
@@ -0,0 +1,117 @@
+/*
+ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://aws.amazon.com/apache2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package software.amazon.awssdk.protocols.rpcv2.internal;
+
+import java.io.IOException;
+import java.time.Instant;
+import software.amazon.awssdk.annotations.SdkInternalApi;
+import software.amazon.awssdk.protocols.json.SdkJsonGenerator;
+import software.amazon.awssdk.protocols.json.StructuredJsonGenerator;
+import software.amazon.awssdk.thirdparty.jackson.core.JsonFactory;
+import software.amazon.awssdk.thirdparty.jackson.dataformat.cbor.CBORGenerator;
+
+/**
+ * Thin wrapper around Jackson's JSON generator for CBOR.
+ */
+@SdkInternalApi
+public final class SdkRpcV2CborGenerator extends SdkJsonGenerator {
+
+ private static final int CBOR_TAG_TIMESTAMP = 1;
+
+ SdkRpcV2CborGenerator(JsonFactory factory, String contentType) {
+ super(factory, contentType);
+ }
+
+ /**
+ * Jackson doesn't have native support for timestamp. As per the RFC 7049 (https://tools.ietf.org/html/rfc7049#section-2.4.1)
+ * we will need to write a tag and write the epoch.
+ */
+ @Override
+ public StructuredJsonGenerator writeValue(Instant instant) {
+ CBORGenerator generator = getGenerator();
+ try {
+ generator.writeTag(CBOR_TAG_TIMESTAMP);
+ generator.writeNumber(instant.toEpochMilli() / 1000d);
+ } catch (IOException e) {
+ throw new JsonGenerationException(e);
+ }
+ return this;
+ }
+
+ @Override
+ public StructuredJsonGenerator writeStartArray(int size) {
+ CBORGenerator generator = getGenerator();
+ try {
+ generator.writeStartArray(null, size);
+ } catch (IOException e) {
+ throw new JsonGenerationException(e);
+ }
+ return this;
+ }
+
+ @Override
+ public StructuredJsonGenerator writeValue(double val) {
+ if (canConvertToLong(val)) {
+ return writeValue((long) val);
+ }
+ CBORGenerator generator = getGenerator();
+ try {
+ generator.writeNumber(val);
+ } catch (IOException e) {
+ throw new JsonGenerationException(e);
+ }
+ return this;
+ }
+
+ @Override
+ public StructuredJsonGenerator writeValue(float val) {
+ if (canConvertToLong(val)) {
+ return writeValue((long) val);
+ }
+ CBORGenerator generator = getGenerator();
+ try {
+ generator.writeNumber(val);
+ } catch (IOException e) {
+ throw new JsonGenerationException(e);
+ }
+ return this;
+ }
+
+ @Override
+ protected CBORGenerator getGenerator() {
+ return (CBORGenerator) super.getGenerator();
+ }
+
+ /**
+ * Checks if we can convert the floating point value to a long. If we can we then use the writeNumber(long), alongside with
+ * having enabled Feature.WRITE_MINIMAL_INTS will allow us to represent the floating point values minimally.
+ */
+ private static boolean canConvertToLong(double value) {
+ return ((double) (long) value) == value
+ && value >= Long.MIN_VALUE
+ && value <= Long.MAX_VALUE;
+ }
+
+ /**
+ * Checks if we can convert the floating point value to a long. If we can we then use the writeNumber(long), alongside with
+ * having enabled Feature.WRITE_MINIMAL_INTS will allow us to represent the floating point values minimally.
+ */
+ private static boolean canConvertToLong(float value) {
+ return ((float) (long) value) == value
+ && value >= Long.MIN_VALUE
+ && value <= Long.MAX_VALUE;
+ }
+}
diff --git a/core/protocols/smithy-rpcv2-protocol/src/main/java/software/amazon/awssdk/protocols/rpcv2/internal/SdkStructuredRpcV2CborFactory.java b/core/protocols/smithy-rpcv2-protocol/src/main/java/software/amazon/awssdk/protocols/rpcv2/internal/SdkStructuredRpcV2CborFactory.java
new file mode 100644
index 000000000000..d595715bdd9a
--- /dev/null
+++ b/core/protocols/smithy-rpcv2-protocol/src/main/java/software/amazon/awssdk/protocols/rpcv2/internal/SdkStructuredRpcV2CborFactory.java
@@ -0,0 +1,55 @@
+/*
+ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://aws.amazon.com/apache2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package software.amazon.awssdk.protocols.rpcv2.internal;
+
+import software.amazon.awssdk.annotations.SdkInternalApi;
+import software.amazon.awssdk.protocols.json.BaseAwsStructuredJsonFactory;
+import software.amazon.awssdk.protocols.json.StructuredJsonGenerator;
+import software.amazon.awssdk.thirdparty.jackson.core.JsonFactory;
+import software.amazon.awssdk.thirdparty.jackson.dataformat.cbor.CBORFactory;
+import software.amazon.awssdk.thirdparty.jackson.dataformat.cbor.CBORFactoryBuilder;
+import software.amazon.awssdk.thirdparty.jackson.dataformat.cbor.CBORGenerator;
+
+/**
+ * Creates generators and protocol handlers for RPCv2 CBOR wire format.
+ */
+@SdkInternalApi
+public final class SdkStructuredRpcV2CborFactory {
+
+ private static final CBORFactory CBOR_FACTORY = new CBORFactoryBuilder(new CBORFactory())
+ /* Allows integers to be represented using as little bytes as possible. This is the default, adding here for clarity */
+ .enable(CBORGenerator.Feature.WRITE_MINIMAL_INTS)
+ /* Allows doubles (8 bytes) to be represented as floats (4 bytes) when possible. */
+ .enable(CBORGenerator.Feature.WRITE_MINIMAL_DOUBLES)
+ .build();
+
+ public static final BaseAwsStructuredJsonFactory SDK_CBOR_FACTORY =
+ new BaseAwsStructuredJsonFactory(CBOR_FACTORY) {
+ @Override
+ protected StructuredJsonGenerator createWriter(JsonFactory jsonFactory,
+ String contentType) {
+ return new SdkRpcV2CborGenerator(jsonFactory, contentType);
+ }
+
+ @Override
+ public CBORFactory getJsonFactory() {
+ return CBOR_FACTORY;
+ }
+ };
+
+ private SdkStructuredRpcV2CborFactory() {
+ }
+}
diff --git a/core/protocols/smithy-rpcv2-protocol/src/test/java/software/amazon/awssdk/protocols/rpcv2/internal/SdkRpcV2CborGeneratorTest.java b/core/protocols/smithy-rpcv2-protocol/src/test/java/software/amazon/awssdk/protocols/rpcv2/internal/SdkRpcV2CborGeneratorTest.java
new file mode 100644
index 000000000000..245706950716
--- /dev/null
+++ b/core/protocols/smithy-rpcv2-protocol/src/test/java/software/amazon/awssdk/protocols/rpcv2/internal/SdkRpcV2CborGeneratorTest.java
@@ -0,0 +1,217 @@
+/*
+ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://aws.amazon.com/apache2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package software.amazon.awssdk.protocols.rpcv2.internal;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+import java.nio.charset.StandardCharsets;
+import java.time.Instant;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Objects;
+import java.util.function.Consumer;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.MethodSource;
+import software.amazon.awssdk.protocols.json.StructuredJsonGenerator;
+
+class SdkRpcV2CborGeneratorTest {
+ private static final byte[] HEX_ARRAY = "0123456789abcdef".getBytes(StandardCharsets.US_ASCII);
+
+ @ParameterizedTest(name = "{index} - {0}")
+ @MethodSource("testCases")
+ public void runTestCases(TestCase testCase) {
+ StructuredJsonGenerator generator = getGenerator();
+ testCase.setup.accept(generator);
+ assertThat(toHexEncoded(generator.getBytes())).isEqualTo(annotatedToHex(testCase.expected));
+ }
+
+ public static Collection testCases() {
+ return Arrays.asList(
+ // Numbers, minimal encoding
+ builder("Minimally encodes longs when they fit as a simple value")
+ .setup(
+ g -> g.writeStartArray(1)
+ .writeValue(23L)
+ .writeEndArray()
+ )
+ .expected(
+ "# https://cbor.nemo157.com/#type=hex&value=8117"
+ , "81 # array(1)"
+ , " 17 # unsigned(23)"
+ )
+ .build()
+ , builder("Minimally encodes longs when they fit in one byte")
+ .setup(
+ g -> g.writeStartArray(1)
+ .writeValue(255L)
+ .writeEndArray()
+ )
+ .expected(
+ "# https://cbor.nemo157.com/#type=hex&value=8118ff"
+ , "81 # array(1)"
+ , " 18 ff # unsigned(255)"
+ )
+ .build()
+ , builder("Minimally encodes longs when they fit in two byte")
+ .setup(
+ g -> g.writeStartArray(1)
+ .writeValue(256L)
+ .writeEndArray()
+ )
+ .expected(
+ "# https://cbor.nemo157.com/#type=hex&value=81190100"
+ , "81 # array(1)"
+ , " 19 0100 # unsigned(256)"
+ )
+ .build()
+ , builder("Minimally encodes floats when are equivalent to ints")
+ .setup(
+ g -> g.writeStartArray(1)
+ .writeValue(23.0F)
+ .writeEndArray()
+ )
+ .expected(
+ "# https://cbor.nemo157.com/#type=hex&value=8117"
+ , "81 # array(1)"
+ , " 17 # unsigned(23)"
+ )
+ .build()
+ , builder("Minimally encodes doubles when are equivalent to ints")
+ .setup(
+ g -> g.writeStartArray(1)
+ .writeValue(23.0)
+ .writeEndArray()
+ )
+ .expected(
+ "# https://cbor.nemo157.com/#type=hex&value=8117"
+ , "81 # array(1)"
+ , " 17 # unsigned(23)"
+ )
+ .build()
+ , builder("Minimally encodes doubles that fit in a float")
+ .setup(
+ g -> g.writeStartArray(1)
+ .writeValue(1.5)
+ .writeEndArray()
+ )
+ .expected(
+ "# https://cbor.nemo157.com/#type=hex&value=81fa3fc00000"
+ , "81 # array(1)"
+ , " fa 3fc00000 # float(1.5)"
+ )
+ .build()
+
+ , builder("Encodes doubles as doubles when needed")
+ .setup(
+ g -> g.writeStartArray(1)
+ .writeValue(3.1415927)
+ .writeEndArray()
+ )
+ .expected(
+ "# https://cbor.nemo157.com/#type=hex&value=81fb400921fb5a7ed197"
+ , "81 # array(1)"
+ , " fb 400921fb5a7ed197 # float(3.1415927)"
+ )
+ .build()
+ // Timestamp as epoch seconds with milliseconds decimal part
+ , builder("Encodes timestamp as epoch seconds with millisecond decimal part")
+ .setup(
+ g -> g.writeStartArray(1)
+ .writeValue(Instant.parse("2024-08-09T18:13:18.426482Z"))
+ .writeEndArray()
+ )
+ .expected(
+ "# https://cbor.nemo157.com/#type=hex&value=81C1FB41D9AD970F9B4396"
+ , "81 # array(1)"
+ , " c1 # epoch datetime value, tag(1)"
+ , " fb 41d9ad970f9b4396 # float(1,723,227,198.426)"
+ , " # datetime(2024-08-09T18:13:18.426000118Z)"
+ )
+ .build()
+ );
+ }
+
+ static TestCaseBuilder builder(String name) {
+ return new TestCaseBuilder()
+ .name(name);
+ }
+
+ private static StructuredJsonGenerator getGenerator() {
+ return SdkStructuredRpcV2CborFactory.SDK_CBOR_FACTORY.createWriter("application/cbor");
+ }
+
+ private String annotatedToHex(String... args) {
+ StringBuilder buf = new StringBuilder();
+ for (String arg : args) {
+ String cleaned = arg.replaceFirst("#.*$", "")
+ .replaceAll("\\s+", "");
+ buf.append(cleaned);
+ }
+ return buf.toString();
+ }
+
+ public static String toHexEncoded(byte[] bytes) {
+ byte[] hexChars = new byte[bytes.length * 2];
+ for (int j = 0; j < bytes.length; j++) {
+ int v = bytes[j] & 0xFF;
+ hexChars[j * 2] = HEX_ARRAY[v >>> 4];
+ hexChars[j * 2 + 1] = HEX_ARRAY[v & 0x0F];
+ }
+ return new String(hexChars, StandardCharsets.UTF_8);
+ }
+
+ static class TestCase {
+ private final String name;
+ private final Consumer setup;
+ private final String[] expected;
+
+ public TestCase(TestCaseBuilder builder) {
+ this.name = Objects.requireNonNull(builder.name, "name");
+ this.setup = Objects.requireNonNull(builder.setup, "setup");
+ this.expected = Objects.requireNonNull(builder.expected, "expected");
+ }
+
+ @Override
+ public String toString() {
+ return name;
+ }
+ }
+
+ static class TestCaseBuilder {
+ private String name;
+ private Consumer setup;
+ private String[] expected;
+
+ public TestCaseBuilder name(String name) {
+ this.name = name;
+ return this;
+ }
+
+ public TestCaseBuilder setup(Consumer setup) {
+ this.setup = setup;
+ return this;
+ }
+
+ public TestCaseBuilder expected(String... expected) {
+ this.expected = expected;
+ return this;
+ }
+
+ public TestCase build() {
+ return new TestCase(this);
+ }
+ }
+}
diff --git a/test/protocol-tests-core/src/main/java/software/amazon/awssdk/protocol/asserts/marshalling/EncodedBodyAssertion.java b/test/protocol-tests-core/src/main/java/software/amazon/awssdk/protocol/asserts/marshalling/EncodedBodyAssertion.java
new file mode 100644
index 000000000000..de84bf877e5b
--- /dev/null
+++ b/test/protocol-tests-core/src/main/java/software/amazon/awssdk/protocol/asserts/marshalling/EncodedBodyAssertion.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://aws.amazon.com/apache2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package software.amazon.awssdk.protocol.asserts.marshalling;
+
+import static org.junit.Assert.assertEquals;
+
+import com.github.tomakehurst.wiremock.verification.LoggedRequest;
+import java.nio.charset.StandardCharsets;
+import java.util.Base64;
+
+/**
+ * Asserts on the body (expected to be CBOR encoded) of the marshalled request.
+ */
+public class EncodedBodyAssertion extends MarshallingAssertion {
+ private final String encodedEquals;
+
+ public EncodedBodyAssertion(String encodedEquals) {
+ this.encodedEquals = encodedEquals;
+ }
+
+ @Override
+ protected void doAssert(LoggedRequest actual) throws Exception {
+ byte[] actualBytes = Base64.getEncoder().encode(actual.getBody());
+ String actualValue = new String(actualBytes, StandardCharsets.UTF_8);
+ assertEquals(encodedEquals, actualValue);
+ }
+}
diff --git a/test/protocol-tests-core/src/main/java/software/amazon/awssdk/protocol/asserts/marshalling/RequestBodyAssertion.java b/test/protocol-tests-core/src/main/java/software/amazon/awssdk/protocol/asserts/marshalling/RequestBodyAssertion.java
index d93d93dc2149..1a1301c7bc55 100644
--- a/test/protocol-tests-core/src/main/java/software/amazon/awssdk/protocol/asserts/marshalling/RequestBodyAssertion.java
+++ b/test/protocol-tests-core/src/main/java/software/amazon/awssdk/protocol/asserts/marshalling/RequestBodyAssertion.java
@@ -25,6 +25,10 @@ public void setJsonEquals(String jsonEquals) {
addAssertion(new JsonBodyAssertion(jsonEquals));
}
+ public void setEncodedEquals(String encodedEquals) {
+ addAssertion(new EncodedBodyAssertion(encodedEquals));
+ }
+
public void setXmlEquals(String xmlEquals) {
addAssertion(new XmlBodyAssertion(xmlEquals));
}
diff --git a/test/protocol-tests-core/src/main/java/software/amazon/awssdk/protocol/model/GivenResponse.java b/test/protocol-tests-core/src/main/java/software/amazon/awssdk/protocol/model/GivenResponse.java
index 5dfbd15e6a81..870417b63894 100644
--- a/test/protocol-tests-core/src/main/java/software/amazon/awssdk/protocol/model/GivenResponse.java
+++ b/test/protocol-tests-core/src/main/java/software/amazon/awssdk/protocol/model/GivenResponse.java
@@ -25,6 +25,7 @@ public class GivenResponse {
private Integer statusCode;
private Map> headers;
private String body;
+ private String binaryBody;
public Integer getStatusCode() {
return statusCode;
@@ -46,7 +47,15 @@ public String getBody() {
return body;
}
+ public String getBinaryBody() {
+ return binaryBody;
+ }
+
public void setBody(String body) {
this.body = body;
}
+
+ public void setBinaryBody(String body) {
+ this.binaryBody = body;
+ }
}
diff --git a/test/protocol-tests-core/src/main/java/software/amazon/awssdk/protocol/runners/UnmarshallingTestRunner.java b/test/protocol-tests-core/src/main/java/software/amazon/awssdk/protocol/runners/UnmarshallingTestRunner.java
index 4560184e88aa..6ee3b88cb010 100644
--- a/test/protocol-tests-core/src/main/java/software/amazon/awssdk/protocol/runners/UnmarshallingTestRunner.java
+++ b/test/protocol-tests-core/src/main/java/software/amazon/awssdk/protocol/runners/UnmarshallingTestRunner.java
@@ -23,6 +23,7 @@
import com.fasterxml.jackson.databind.JsonNode;
import com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder;
import com.github.tomakehurst.wiremock.client.WireMock;
+import java.util.Base64;
import software.amazon.awssdk.codegen.model.intermediate.IntermediateModel;
import software.amazon.awssdk.codegen.model.intermediate.Metadata;
import software.amazon.awssdk.core.sync.ResponseTransformer;
@@ -108,6 +109,8 @@ private ResponseDefinitionBuilder toResponseBuilder(GivenResponse givenResponse)
}
if (givenResponse.getBody() != null) {
responseBuilder.withBody(givenResponse.getBody());
+ } else if (givenResponse.getBinaryBody() != null) {
+ responseBuilder.withBody(Base64.getDecoder().decode(givenResponse.getBinaryBody()));
} else if (metadata.isXmlProtocol()) {
// XML Unmarshallers expect at least one level in the XML document. If no body is explicitly
// set by the test add a fake one here.
diff --git a/test/protocol-tests-core/src/main/resources/software/amazon/awssdk/protocol/suites/cases/smithy-rpcv2-input.json b/test/protocol-tests-core/src/main/resources/software/amazon/awssdk/protocol/suites/cases/smithy-rpcv2-input.json
new file mode 100644
index 000000000000..62b74014c133
--- /dev/null
+++ b/test/protocol-tests-core/src/main/resources/software/amazon/awssdk/protocol/suites/cases/smithy-rpcv2-input.json
@@ -0,0 +1,560 @@
+[
+ {
+ "description": "Serializes null values in lists",
+ "given": {
+ "input": {
+ "sparseStringList": [
+ null
+ ]
+ }
+ },
+ "when": {
+ "action": "marshall",
+ "operation": "SparseNullsOperation"
+ },
+ "then": {
+ "serializedAs": {
+ "body": {
+ "encodedEquals": "v3BzcGFyc2VTdHJpbmdMaXN0gfb/"
+ },
+ "headers": {
+ "contains": {
+ "Content-Type": "application/cbor",
+ "smithy-protocol": "rpc-v2-cbor"
+ }
+ }
+ }
+ }
+ },
+ {
+ "description": "Serializes recursive structures",
+ "given": {
+ "input": {
+ "nested": {
+ "foo": "Foo1",
+ "nested": {
+ "bar": "Bar1",
+ "recursiveMember": {
+ "foo": "Foo2",
+ "nested": {
+ "bar": "Bar2"
+ }
+ }
+ }
+ }
+ }
+ },
+ "when": {
+ "action": "marshall",
+ "operation": "RecursiveShapes"
+ },
+ "then": {
+ "serializedAs": {
+ "body": {
+ "encodedEquals": "v2ZuZXN0ZWS/Y2Zvb2RGb28xZm5lc3RlZL9jYmFyZEJhcjFvcmVjdXJzaXZlTWVtYmVyv2Nmb29kRm9vMmZuZXN0ZWS/Y2JhcmRCYXIy//////8="
+ },
+ "headers": {
+ "contains": {
+ "Content-Type": "application/cbor",
+ "smithy-protocol": "rpc-v2-cbor"
+ }
+ }
+ }
+ }
+ },
+ {
+ "description": "Serializes sparse maps",
+ "given": {
+ "input": {
+ "sparseStructMap": {
+ "foo": {
+ "hi": "there"
+ },
+ "baz": {
+ "hi": "bye"
+ }
+ }
+ }
+ },
+ "when": {
+ "action": "marshall",
+ "operation": "RpcV2CborSparseMaps"
+ },
+ "then": {
+ "serializedAs": {
+ "body": {
+ "encodedEquals": "v29zcGFyc2VTdHJ1Y3RNYXC/Y2Zvb79iaGlldGhlcmX/Y2Jher9iaGljYnll////"
+ },
+ "headers": {
+ "contains": {
+ "Content-Type": "application/cbor",
+ "smithy-protocol": "rpc-v2-cbor"
+ }
+ }
+ }
+ }
+ },
+ {
+ "description": "A request that contains a sparse map of sets",
+ "given": {
+ "input": {
+ "sparseSetMap": {
+ "x": [],
+ "y": [
+ "a",
+ "b"
+ ]
+ }
+ }
+ },
+ "when": {
+ "action": "marshall",
+ "operation": "RpcV2CborSparseMaps"
+ },
+ "then": {
+ "serializedAs": {
+ "body": {
+ "encodedEquals": "v2xzcGFyc2VTZXRNYXC/YXiAYXmCYWFhYv//"
+ },
+ "headers": {
+ "contains": {
+ "Content-Type": "application/cbor",
+ "smithy-protocol": "rpc-v2-cbor"
+ }
+ }
+ }
+ }
+ },
+ {
+ "description": "Ensure that 0 and false are sent over the wire in all maps and lists",
+ "given": {
+ "input": {
+ "sparseNumberMap": {
+ "x": 0
+ },
+ "sparseBooleanMap": {
+ "x": false
+ }
+ }
+ },
+ "when": {
+ "action": "marshall",
+ "operation": "RpcV2CborSparseMaps"
+ },
+ "then": {
+ "serializedAs": {
+ "body": {
+ "encodedEquals": "v29zcGFyc2VOdW1iZXJNYXC/YXgA/3BzcGFyc2VCb29sZWFuTWFwv2F49P//"
+ },
+ "headers": {
+ "contains": {
+ "Content-Type": "application/cbor",
+ "smithy-protocol": "rpc-v2-cbor"
+ }
+ }
+ }
+ }
+ },
+ {
+ "description": "Serializes maps",
+ "given": {
+ "input": {
+ "denseStructMap": {
+ "foo": {
+ "hi": "there"
+ },
+ "baz": {
+ "hi": "bye"
+ }
+ }
+ }
+ },
+ "when": {
+ "action": "marshall",
+ "operation": "RpcV2CborDenseMaps"
+ },
+ "then": {
+ "serializedAs": {
+ "body": {
+ "encodedEquals": "v25kZW5zZVN0cnVjdE1hcL9jZm9vv2JoaWV0aGVyZf9jYmF6v2JoaWNieWX///8="
+ },
+ "headers": {
+ "contains": {
+ "Content-Type": "application/cbor",
+ "smithy-protocol": "rpc-v2-cbor"
+ }
+ }
+ }
+ }
+ },
+ {
+ "description": "Ensure that 0 and false are sent over the wire in all maps and lists",
+ "given": {
+ "input": {
+ "denseNumberMap": {
+ "x": 0
+ },
+ "denseBooleanMap": {
+ "x": false
+ }
+ }
+ },
+ "when": {
+ "action": "marshall",
+ "operation": "RpcV2CborDenseMaps"
+ },
+ "then": {
+ "serializedAs": {
+ "body": {
+ "encodedEquals": "v25kZW5zZU51bWJlck1hcL9heAD/b2RlbnNlQm9vbGVhbk1hcL9hePT//w=="
+ },
+ "headers": {
+ "contains": {
+ "Content-Type": "application/cbor",
+ "smithy-protocol": "rpc-v2-cbor"
+ }
+ }
+ }
+ }
+ },
+ {
+ "description": "A request that contains a dense map of sets.",
+ "given": {
+ "input": {
+ "denseSetMap": {
+ "x": [],
+ "y": [
+ "a",
+ "b"
+ ]
+ }
+ }
+ },
+ "when": {
+ "action": "marshall",
+ "operation": "RpcV2CborDenseMaps"
+ },
+ "then": {
+ "serializedAs": {
+ "body": {
+ "encodedEquals": "v2tkZW5zZVNldE1hcL9heIBheYJhYWFi//8="
+ },
+ "headers": {
+ "contains": {
+ "Content-Type": "application/cbor",
+ "smithy-protocol": "rpc-v2-cbor"
+ }
+ }
+ }
+ }
+ },
+ {
+ "description": "Serializes RpcV2 Cbor lists",
+ "given": {
+ "input": {
+ "stringList": [
+ "foo",
+ "bar"
+ ],
+ "stringSet": [
+ "foo",
+ "bar"
+ ],
+ "integerList": [
+ 1,
+ 2
+ ],
+ "booleanList": [
+ true,
+ false
+ ],
+ "timestampList": [
+ 1398796238000,
+ 1398796238000
+ ],
+ "enumList": [
+ "Foo",
+ "0"
+ ],
+ "intEnumList": [
+ 1,
+ 2
+ ],
+ "nestedStringList": [
+ [
+ "foo",
+ "bar"
+ ],
+ [
+ "baz",
+ "qux"
+ ]
+ ],
+ "structureList": [
+ {
+ "a": "1",
+ "b": "2"
+ },
+ {
+ "a": "3",
+ "b": "4"
+ }
+ ],
+ "blobList": [
+ "foo",
+ "bar"
+ ]
+ }
+ },
+ "when": {
+ "action": "marshall",
+ "operation": "RpcV2CborLists"
+ },
+ "then": {
+ "serializedAs": {
+ "body": {
+ "encodedEquals": "v2pzdHJpbmdMaXN0gmNmb29jYmFyaXN0cmluZ1NldIJjZm9vY2JhcmtpbnRlZ2VyTGlzdIIBAmtib29sZWFuTGlzdIL19G10aW1lc3RhbXBMaXN0gsH7QdTX+/OAAADB+0HU1/vzgAAAaGVudW1MaXN0gmNGb29hMGtpbnRFbnVtTGlzdIIBAnBuZXN0ZWRTdHJpbmdMaXN0goJjZm9vY2JhcoJjYmF6Y3F1eG1zdHJ1Y3R1cmVMaXN0gr9hYWExYWJhMv+/YWFhM2FiYTT/aGJsb2JMaXN0gkNmb29DYmFy/w=="
+ },
+ "headers": {
+ "contains": {
+ "Content-Type": "application/cbor",
+ "smithy-protocol": "rpc-v2-cbor"
+ }
+ }
+ }
+ }
+ },
+ {
+ "description": "Serializes empty JSON lists",
+ "given": {
+ "input": {
+ "stringList": []
+ }
+ },
+ "when": {
+ "action": "marshall",
+ "operation": "RpcV2CborLists"
+ },
+ "then": {
+ "serializedAs": {
+ "body": {
+ "encodedEquals": "v2pzdHJpbmdMaXN0gP8="
+ },
+ "headers": {
+ "contains": {
+ "Content-Type": "application/cbor",
+ "smithy-protocol": "rpc-v2-cbor"
+ }
+ }
+ }
+ }
+ },
+ {
+ "description": "Serializes empty JSON definite length lists",
+ "given": {
+ "input": {
+ "stringList": []
+ }
+ },
+ "when": {
+ "action": "marshall",
+ "operation": "RpcV2CborLists"
+ },
+ "then": {
+ "serializedAs": {
+ "body": {
+ "encodedEquals": "v2pzdHJpbmdMaXN0gP8="
+ },
+ "headers": {
+ "contains": {
+ "Content-Type": "application/cbor",
+ "smithy-protocol": "rpc-v2-cbor"
+ }
+ }
+ }
+ }
+ },
+ {
+ "description": "Serializes simple scalar properties",
+ "given": {
+ "input": {
+ "trueBooleanValue": true,
+ "falseBooleanValue": false,
+ "byteValue": 5,
+ "doubleValue": 1.889,
+ "floatValue": 7.625,
+ "integerValue": 256,
+ "longValue": 9873,
+ "shortValue": 9898,
+ "stringValue": "simple",
+ "blobValue": "foo"
+ }
+ },
+ "when": {
+ "action": "marshall",
+ "operation": "SimpleScalarProperties"
+ },
+ "then": {
+ "serializedAs": {
+ "body": {
+ "encodedEquals": "v3B0cnVlQm9vbGVhblZhbHVl9XFmYWxzZUJvb2xlYW5WYWx1ZfRpYnl0ZVZhbHVlBWtkb3VibGVWYWx1Zfs//jlYEGJN02pmbG9hdFZhbHVl+kD0AABsaW50ZWdlclZhbHVlGQEAaWxvbmdWYWx1ZRkmkWpzaG9ydFZhbHVlGSaqa3N0cmluZ1ZhbHVlZnNpbXBsZWlibG9iVmFsdWVDZm9v/w=="
+ },
+ "headers": {
+ "contains": {
+ "Content-Type": "application/cbor",
+ "smithy-protocol": "rpc-v2-cbor"
+ }
+ }
+ }
+ }
+ },
+ {
+ "description": "RpcV2 Cbor should not serialize null structure values",
+ "given": {
+ "input": {
+ "stringValue": null
+ }
+ },
+ "when": {
+ "action": "marshall",
+ "operation": "SimpleScalarProperties"
+ },
+ "then": {
+ "serializedAs": {
+ "body": {
+ "encodedEquals": "v/8="
+ },
+ "headers": {
+ "contains": {
+ "Content-Type": "application/cbor",
+ "smithy-protocol": "rpc-v2-cbor"
+ }
+ }
+ }
+ }
+ },
+ {
+ "description": "Supports handling NaN float values.",
+ "given": {
+ "input": {
+ "doubleValue": "NaN",
+ "floatValue": "NaN"
+ }
+ },
+ "when": {
+ "action": "marshall",
+ "operation": "SimpleScalarProperties"
+ },
+ "then": {
+ "serializedAs": {
+ "body": {
+ "encodedEquals": "v2tkb3VibGVWYWx1Zft/+AAAAAAAAGpmbG9hdFZhbHVl+n/AAAD/"
+ },
+ "headers": {
+ "contains": {
+ "Content-Type": "application/cbor",
+ "smithy-protocol": "rpc-v2-cbor"
+ }
+ }
+ }
+ }
+ },
+ {
+ "description": "Supports handling Infinity float values.",
+ "given": {
+ "input": {
+ "doubleValue": "Infinity",
+ "floatValue": "Infinity"
+ }
+ },
+ "when": {
+ "action": "marshall",
+ "operation": "SimpleScalarProperties"
+ },
+ "then": {
+ "serializedAs": {
+ "body": {
+ "encodedEquals": "v2tkb3VibGVWYWx1Zfp/gAAAamZsb2F0VmFsdWX6f4AAAP8="
+ },
+ "headers": {
+ "contains": {
+ "Content-Type": "application/cbor",
+ "smithy-protocol": "rpc-v2-cbor"
+ }
+ }
+ }
+ }
+ },
+ {
+ "description": "Supports handling Infinity float values.",
+ "given": {
+ "input": {
+ "doubleValue": "-Infinity",
+ "floatValue": "-Infinity"
+ }
+ },
+ "when": {
+ "action": "marshall",
+ "operation": "SimpleScalarProperties"
+ },
+ "then": {
+ "serializedAs": {
+ "body": {
+ "encodedEquals": "v2tkb3VibGVWYWx1Zfr/gAAAamZsb2F0VmFsdWX6/4AAAP8="
+ },
+ "headers": {
+ "contains": {
+ "Content-Type": "application/cbor",
+ "smithy-protocol": "rpc-v2-cbor"
+ }
+ }
+ }
+ }
+ },
+ {
+ "description": "When input is empty we write CBOR equivalent of {}",
+ "given": {
+ "input": {}
+ },
+ "when": {
+ "action": "marshall",
+ "operation": "OptionalInputOutput"
+ },
+ "then": {
+ "serializedAs": {
+ "body": {
+ "encodedEquals": "v/8="
+ },
+ "headers": {
+ "contains": {
+ "Content-Type": "application/cbor",
+ "smithy-protocol": "rpc-v2-cbor"
+ }
+ }
+ }
+ }
+ },
+ {
+ "description": "When Input structure is empty we write CBOR equivalent of {}",
+ "given": {
+ "input": {}
+ },
+ "when": {
+ "action": "marshall",
+ "operation": "EmptyInputOutput"
+ },
+ "then": {
+ "serializedAs": {
+ "body": {
+ "encodedEquals": "v/8="
+ },
+ "headers": {
+ "contains": {
+ "Content-Type": "application/cbor",
+ "smithy-protocol": "rpc-v2-cbor"
+ }
+ }
+ }
+ }
+ }
+]
\ No newline at end of file
diff --git a/test/protocol-tests-core/src/main/resources/software/amazon/awssdk/protocol/suites/cases/smithy-rpcv2-output.json b/test/protocol-tests-core/src/main/resources/software/amazon/awssdk/protocol/suites/cases/smithy-rpcv2-output.json
new file mode 100644
index 000000000000..bc82842c02d5
--- /dev/null
+++ b/test/protocol-tests-core/src/main/resources/software/amazon/awssdk/protocol/suites/cases/smithy-rpcv2-output.json
@@ -0,0 +1,667 @@
+[
+ {
+ "description": "Ensures that clients can correctly parse float16 +Inf.",
+ "given": {
+ "response": {
+ "status_code": 200,
+ "binaryBody": "oWV2YWx1Zfl8AA=="
+ }
+ },
+ "when": {
+ "action": "unmarshall",
+ "operation": "Float16"
+ },
+ "then": {
+ "deserializedAs": {
+ "value": "Infinity"
+ }
+ }
+ },
+ {
+ "description": "Ensures that clients can correctly parse float16 -Inf.",
+ "given": {
+ "response": {
+ "status_code": 200,
+ "binaryBody": "oWV2YWx1Zfn8AA=="
+ }
+ },
+ "when": {
+ "action": "unmarshall",
+ "operation": "Float16"
+ },
+ "then": {
+ "deserializedAs": {
+ "value": "-Infinity"
+ }
+ }
+ },
+ {
+ "description": "Ensures that clients can correctly parse float16 NaN with high LSB.",
+ "given": {
+ "response": {
+ "status_code": 200,
+ "binaryBody": "oWV2YWx1Zfl8AQ=="
+ }
+ },
+ "when": {
+ "action": "unmarshall",
+ "operation": "Float16"
+ },
+ "then": {
+ "deserializedAs": {
+ "value": "NaN"
+ }
+ }
+ },
+ {
+ "description": "Ensures that clients can correctly parse float16 NaN with high MSB.",
+ "given": {
+ "response": {
+ "status_code": 200,
+ "binaryBody": "oWV2YWx1Zfl+AA=="
+ }
+ },
+ "when": {
+ "action": "unmarshall",
+ "operation": "Float16"
+ },
+ "then": {
+ "deserializedAs": {
+ "value": "NaN"
+ }
+ }
+ },
+ {
+ "description": "Deserializes null values in lists",
+ "given": {
+ "response": {
+ "status_code": 200,
+ "binaryBody": "v3BzcGFyc2VTdHJpbmdMaXN0n/b//w=="
+ }
+ },
+ "when": {
+ "action": "unmarshall",
+ "operation": "SparseNullsOperation"
+ },
+ "then": {
+ "deserializedAs": {
+ "sparseStringList": [
+ null
+ ]
+ }
+ }
+ },
+ {
+ "description": "Ensures that clients can correctly parse timestamps with fractional seconds",
+ "given": {
+ "response": {
+ "status_code": 200,
+ "binaryBody": "v2hkYXRldGltZcH7Qcw32zgPvnf/"
+ }
+ },
+ "when": {
+ "action": "unmarshall",
+ "operation": "FractionalSeconds"
+ },
+ "then": {
+ "deserializedAs": {
+ "datetime": 946845296123
+ }
+ }
+ },
+ {
+ "description": "Serializes recursive structures",
+ "given": {
+ "response": {
+ "status_code": 200,
+ "binaryBody": "v2ZuZXN0ZWS/Y2Zvb2RGb28xZm5lc3RlZL9jYmFyZEJhcjFvcmVjdXJzaXZlTWVtYmVyv2Nmb29kRm9vMmZuZXN0ZWS/Y2JhcmRCYXIy//////8="
+ }
+ },
+ "when": {
+ "action": "unmarshall",
+ "operation": "RecursiveShapes"
+ },
+ "then": {
+ "deserializedAs": {
+ "nested": {
+ "foo": "Foo1",
+ "nested": {
+ "bar": "Bar1",
+ "recursiveMember": {
+ "foo": "Foo2",
+ "nested": {
+ "bar": "Bar2"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ {
+ "description": "Deserializes recursive structures encoded using a map with definite length",
+ "given": {
+ "response": {
+ "status_code": 200,
+ "binaryBody": "oWZuZXN0ZWSiY2Zvb2RGb28xZm5lc3RlZKJjYmFyZEJhcjFvcmVjdXJzaXZlTWVtYmVyomNmb29kRm9vMmZuZXN0ZWShY2JhcmRCYXIy"
+ }
+ },
+ "when": {
+ "action": "unmarshall",
+ "operation": "RecursiveShapes"
+ },
+ "then": {
+ "deserializedAs": {
+ "nested": {
+ "foo": "Foo1",
+ "nested": {
+ "bar": "Bar1",
+ "recursiveMember": {
+ "foo": "Foo2",
+ "nested": {
+ "bar": "Bar2"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ {
+ "description": "Deserializes sparse maps",
+ "given": {
+ "response": {
+ "status_code": 200,
+ "binaryBody": "v29zcGFyc2VTdHJ1Y3RNYXC/Y2Zvb79iaGlldGhlcmX/Y2Jher9iaGljYnll////"
+ }
+ },
+ "when": {
+ "action": "unmarshall",
+ "operation": "RpcV2CborSparseMaps"
+ },
+ "then": {
+ "deserializedAs": {
+ "sparseStructMap": {
+ "foo": {
+ "hi": "there"
+ },
+ "baz": {
+ "hi": "bye"
+ }
+ }
+ }
+ }
+ },
+ {
+ "description": "A response that contains a sparse map of sets",
+ "given": {
+ "response": {
+ "status_code": 200,
+ "binaryBody": "v2xzcGFyc2VTZXRNYXC/YXmfYWFhYv9heJ////8="
+ }
+ },
+ "when": {
+ "action": "unmarshall",
+ "operation": "RpcV2CborSparseMaps"
+ },
+ "then": {
+ "deserializedAs": {
+ "sparseSetMap": {
+ "x": [],
+ "y": [
+ "a",
+ "b"
+ ]
+ }
+ }
+ }
+ },
+ {
+ "description": "Ensure that 0 and false are sent over the wire in all maps and lists",
+ "given": {
+ "response": {
+ "status_code": 200,
+ "binaryBody": "v29zcGFyc2VOdW1iZXJNYXC/YXgA/3BzcGFyc2VCb29sZWFuTWFwv2F49P//"
+ }
+ },
+ "when": {
+ "action": "unmarshall",
+ "operation": "RpcV2CborSparseMaps"
+ },
+ "then": {
+ "deserializedAs": {
+ "sparseNumberMap": {
+ "x": 0
+ },
+ "sparseBooleanMap": {
+ "x": false
+ }
+ }
+ }
+ },
+ {
+ "description": "Deserializes maps",
+ "given": {
+ "response": {
+ "status_code": 200,
+ "binaryBody": "oW5kZW5zZVN0cnVjdE1hcKJjZm9voWJoaWV0aGVyZWNiYXqhYmhpY2J5ZQ=="
+ }
+ },
+ "when": {
+ "action": "unmarshall",
+ "operation": "RpcV2CborDenseMaps"
+ },
+ "then": {
+ "deserializedAs": {
+ "denseStructMap": {
+ "foo": {
+ "hi": "there"
+ },
+ "baz": {
+ "hi": "bye"
+ }
+ }
+ }
+ }
+ },
+ {
+ "description": "Ensure that 0 and false are sent over the wire in all maps and lists",
+ "given": {
+ "response": {
+ "status_code": 200,
+ "binaryBody": "om5kZW5zZU51bWJlck1hcKFheABvZGVuc2VCb29sZWFuTWFwoWF49A=="
+ }
+ },
+ "when": {
+ "action": "unmarshall",
+ "operation": "RpcV2CborDenseMaps"
+ },
+ "then": {
+ "deserializedAs": {
+ "denseNumberMap": {
+ "x": 0
+ },
+ "denseBooleanMap": {
+ "x": false
+ }
+ }
+ }
+ },
+ {
+ "description": "A response that contains a dense map of sets",
+ "given": {
+ "response": {
+ "status_code": 200,
+ "binaryBody": "oWtkZW5zZVNldE1hcKJheIBheYJhYWFi"
+ }
+ },
+ "when": {
+ "action": "unmarshall",
+ "operation": "RpcV2CborDenseMaps"
+ },
+ "then": {
+ "deserializedAs": {
+ "denseSetMap": {
+ "x": [],
+ "y": [
+ "a",
+ "b"
+ ]
+ }
+ }
+ }
+ },
+ {
+ "description": "Serializes RpcV2 Cbor lists",
+ "given": {
+ "response": {
+ "status_code": 200,
+ "binaryBody": "v2pzdHJpbmdMaXN0n2Nmb29jYmFy/2lzdHJpbmdTZXSfY2Zvb2NiYXL/a2ludGVnZXJMaXN0nwEC/2tib29sZWFuTGlzdJ/19P9tdGltZXN0YW1wTGlzdJ/B+0HU1/vzgAAAwftB1Nf784AAAP9oZW51bUxpc3SfY0Zvb2Ew/2tpbnRFbnVtTGlzdJ8BAv9wbmVzdGVkU3RyaW5nTGlzdJ+fY2Zvb2NiYXL/n2NiYXpjcXV4//9tc3RydWN0dXJlTGlzdJ+/YWFhMWFiYTL/v2FhYTNhYmE0//9oYmxvYkxpc3SfQ2Zvb0NiYXL//w=="
+ }
+ },
+ "when": {
+ "action": "unmarshall",
+ "operation": "RpcV2CborLists"
+ },
+ "then": {
+ "deserializedAs": {
+ "stringList": [
+ "foo",
+ "bar"
+ ],
+ "stringSet": [
+ "foo",
+ "bar"
+ ],
+ "integerList": [
+ 1,
+ 2
+ ],
+ "booleanList": [
+ true,
+ false
+ ],
+ "timestampList": [
+ 1398796238000,
+ 1398796238000
+ ],
+ "enumList": [
+ "Foo",
+ "0"
+ ],
+ "intEnumList": [
+ 1,
+ 2
+ ],
+ "nestedStringList": [
+ [
+ "foo",
+ "bar"
+ ],
+ [
+ "baz",
+ "qux"
+ ]
+ ],
+ "structureList": [
+ {
+ "a": "1",
+ "b": "2"
+ },
+ {
+ "a": "3",
+ "b": "4"
+ }
+ ],
+ "blobList": [
+ "foo",
+ "bar"
+ ]
+ }
+ }
+ },
+ {
+ "description": "Serializes empty RpcV2 Cbor lists",
+ "given": {
+ "response": {
+ "status_code": 200,
+ "binaryBody": "v2pzdHJpbmdMaXN0n///"
+ }
+ },
+ "when": {
+ "action": "unmarshall",
+ "operation": "RpcV2CborLists"
+ },
+ "then": {
+ "deserializedAs": {
+ "stringList": []
+ }
+ }
+ },
+ {
+ "description": "Can deserialize indefinite length text strings inside an indefinite length list",
+ "given": {
+ "response": {
+ "status_code": 200,
+ "binaryBody": "v2pzdHJpbmdMaXN0n394HUFuIGV4YW1wbGUgaW5kZWZpbml0ZSBzdHJpbmcsdyB3aGljaCB3aWxsIGJlIGNodW5rZWQsbiBvbiBlYWNoIGNvbW1h/394NUFub3RoZXIgZXhhbXBsZSBpbmRlZmluaXRlIHN0cmluZyB3aXRoIG9ubHkgb25lIGNodW5r/3ZUaGlzIGlzIGEgcGxhaW4gc3RyaW5n//8="
+ }
+ },
+ "when": {
+ "action": "unmarshall",
+ "operation": "RpcV2CborLists"
+ },
+ "then": {
+ "deserializedAs": {
+ "stringList": [
+ "An example indefinite string, which will be chunked, on each comma",
+ "Another example indefinite string with only one chunk",
+ "This is a plain string"
+ ]
+ }
+ }
+ },
+ {
+ "description": "Can deserialize indefinite length text strings inside a definite length list",
+ "given": {
+ "response": {
+ "status_code": 200,
+ "binaryBody": "oWpzdHJpbmdMaXN0g394HUFuIGV4YW1wbGUgaW5kZWZpbml0ZSBzdHJpbmcsdyB3aGljaCB3aWxsIGJlIGNodW5rZWQsbiBvbiBlYWNoIGNvbW1h/394NUFub3RoZXIgZXhhbXBsZSBpbmRlZmluaXRlIHN0cmluZyB3aXRoIG9ubHkgb25lIGNodW5r/3ZUaGlzIGlzIGEgcGxhaW4gc3RyaW5n"
+ }
+ },
+ "when": {
+ "action": "unmarshall",
+ "operation": "RpcV2CborLists"
+ },
+ "then": {
+ "deserializedAs": {
+ "stringList": [
+ "An example indefinite string, which will be chunked, on each comma",
+ "Another example indefinite string with only one chunk",
+ "This is a plain string"
+ ]
+ }
+ }
+ },
+ {
+ "description": "Serializes simple scalar properties",
+ "given": {
+ "response": {
+ "status_code": 200,
+ "binaryBody": "v3B0cnVlQm9vbGVhblZhbHVl9XFmYWxzZUJvb2xlYW5WYWx1ZfRpYnl0ZVZhbHVlBWtkb3VibGVWYWx1Zfs//jlYEGJN02pmbG9hdFZhbHVl+kD0AABsaW50ZWdlclZhbHVlGQEAanNob3J0VmFsdWUZJqprc3RyaW5nVmFsdWVmc2ltcGxlaWJsb2JWYWx1ZUNmb2//"
+ }
+ },
+ "when": {
+ "action": "unmarshall",
+ "operation": "SimpleScalarProperties"
+ },
+ "then": {
+ "deserializedAs": {
+ "trueBooleanValue": true,
+ "falseBooleanValue": false,
+ "byteValue": 5,
+ "doubleValue": 1.889,
+ "floatValue": 7.625,
+ "integerValue": 256,
+ "shortValue": 9898,
+ "stringValue": "simple",
+ "blobValue": "foo"
+ }
+ }
+ },
+ {
+ "description": "Deserializes simple scalar properties encoded using a map with definite length",
+ "given": {
+ "response": {
+ "status_code": 200,
+ "binaryBody": "qXB0cnVlQm9vbGVhblZhbHVl9XFmYWxzZUJvb2xlYW5WYWx1ZfRpYnl0ZVZhbHVlBWtkb3VibGVWYWx1Zfs//jlYEGJN02pmbG9hdFZhbHVl+kD0AABsaW50ZWdlclZhbHVlGQEAanNob3J0VmFsdWUZJqprc3RyaW5nVmFsdWVmc2ltcGxlaWJsb2JWYWx1ZUNmb28="
+ }
+ },
+ "when": {
+ "action": "unmarshall",
+ "operation": "SimpleScalarProperties"
+ },
+ "then": {
+ "deserializedAs": {
+ "trueBooleanValue": true,
+ "falseBooleanValue": false,
+ "byteValue": 5,
+ "doubleValue": 1.889,
+ "floatValue": 7.625,
+ "integerValue": 256,
+ "shortValue": 9898,
+ "stringValue": "simple",
+ "blobValue": "foo"
+ }
+ }
+ },
+ {
+ "description": "RpcV2 Cbor should not deserialize null structure values",
+ "given": {
+ "response": {
+ "status_code": 200,
+ "binaryBody": "v2tzdHJpbmdWYWx1Zfb/"
+ }
+ },
+ "when": {
+ "action": "unmarshall",
+ "operation": "SimpleScalarProperties"
+ },
+ "then": {
+ "deserializedAs": {}
+ }
+ },
+ {
+ "description": "Supports handling NaN float values.",
+ "given": {
+ "response": {
+ "status_code": 200,
+ "binaryBody": "v2tkb3VibGVWYWx1Zft/+AAAAAAAAGpmbG9hdFZhbHVl+n/AAAD/"
+ }
+ },
+ "when": {
+ "action": "unmarshall",
+ "operation": "SimpleScalarProperties"
+ },
+ "then": {
+ "deserializedAs": {
+ "doubleValue": "NaN",
+ "floatValue": "NaN"
+ }
+ }
+ },
+ {
+ "description": "Supports handling Infinity float values.",
+ "given": {
+ "response": {
+ "status_code": 200,
+ "binaryBody": "v2tkb3VibGVWYWx1Zft/8AAAAAAAAGpmbG9hdFZhbHVl+n+AAAD/"
+ }
+ },
+ "when": {
+ "action": "unmarshall",
+ "operation": "SimpleScalarProperties"
+ },
+ "then": {
+ "deserializedAs": {
+ "doubleValue": "Infinity",
+ "floatValue": "Infinity"
+ }
+ }
+ },
+ {
+ "description": "Supports handling Negative Infinity float values.",
+ "given": {
+ "response": {
+ "status_code": 200,
+ "binaryBody": "v2tkb3VibGVWYWx1Zfv/8AAAAAAAAGpmbG9hdFZhbHVl+v+AAAD/"
+ }
+ },
+ "when": {
+ "action": "unmarshall",
+ "operation": "SimpleScalarProperties"
+ },
+ "then": {
+ "deserializedAs": {
+ "doubleValue": "-Infinity",
+ "floatValue": "-Infinity"
+ }
+ }
+ },
+ {
+ "description": "Supports upcasting from a smaller byte representation of the same data type.",
+ "given": {
+ "response": {
+ "status_code": 200,
+ "binaryBody": "v2tkb3VibGVWYWx1Zfk+AGpmbG9hdFZhbHVl+UegbGludGVnZXJWYWx1ZRg4aWxvbmdWYWx1ZRkBAGpzaG9ydFZhbHVlCv8="
+ }
+ },
+ "when": {
+ "action": "unmarshall",
+ "operation": "SimpleScalarProperties"
+ },
+ "then": {
+ "deserializedAs": {
+ "doubleValue": 1.5,
+ "floatValue": 7.625,
+ "integerValue": 56,
+ "longValue": 256,
+ "shortValue": 10
+ }
+ }
+ },
+ {
+ "description": "The client should skip over additional fields that are not part of the structure. This allows a\nclient generated against an older Smithy model to be able to communicate with a server that is\ngenerated against a newer Smithy model.",
+ "given": {
+ "response": {
+ "status_code": 200,
+ "binaryBody": "v2lieXRlVmFsdWUFa2RvdWJsZVZhbHVl+z/+OVgQYk3TcWZhbHNlQm9vbGVhblZhbHVl9GpmbG9hdFZhbHVl+kD0AABrZXh0cmFPYmplY3S/c2luZGVmaW5pdGVMZW5ndGhNYXC/a3dpdGhBbkFycmF5nwECA///cWRlZmluaXRlTGVuZ3RoTWFwo3J3aXRoQURlZmluaXRlQXJyYXmDAQIDeB1hbmRTb21lSW5kZWZpbml0ZUxlbmd0aFN0cmluZ3gfdGhhdCBoYXMsIGJlZW4gY2h1bmtlZCBvbiBjb21tYWxub3JtYWxTdHJpbmdjZm9vanNob3J0VmFsdWUZJw9uc29tZU90aGVyRmllbGR2dGhpcyBzaG91bGQgYmUgc2tpcHBlZP9saW50ZWdlclZhbHVlGQEAaWxvbmdWYWx1ZRkmkWpzaG9ydFZhbHVlGSaqa3N0cmluZ1ZhbHVlZnNpbXBsZXB0cnVlQm9vbGVhblZhbHVl9WlibG9iVmFsdWVDZm9v/w=="
+ }
+ },
+ "when": {
+ "action": "unmarshall",
+ "operation": "SimpleScalarProperties"
+ },
+ "then": {
+ "deserializedAs": {
+ "trueBooleanValue": true,
+ "falseBooleanValue": false,
+ "byteValue": 5,
+ "doubleValue": 1.889,
+ "floatValue": 7.625,
+ "integerValue": 256,
+ "longValue": 9873,
+ "shortValue": 9898,
+ "stringValue": "simple",
+ "blobValue": "foo"
+ }
+ }
+ },
+ {
+ "description": "When output is empty we write CBOR equivalent of {}",
+ "given": {
+ "response": {
+ "status_code": 200,
+ "binaryBody": "v/8="
+ }
+ },
+ "when": {
+ "action": "unmarshall",
+ "operation": "OptionalInputOutput"
+ },
+ "then": {
+ "deserializedAs": {}
+ }
+ },
+ {
+ "description": "When output structure is empty we write CBOR equivalent of {}",
+ "given": {
+ "response": {
+ "status_code": 200,
+ "binaryBody": "v/8="
+ }
+ },
+ "when": {
+ "action": "unmarshall",
+ "operation": "EmptyInputOutput"
+ },
+ "then": {
+ "deserializedAs": {}
+ }
+ },
+ {
+ "description": "Clients should accept a CBOR empty struct if there is no output.",
+ "given": {
+ "response": {
+ "status_code": 200,
+ "binaryBody": "v/8="
+ }
+ },
+ "when": {
+ "action": "unmarshall",
+ "operation": "NoInputOutput"
+ },
+ "then": {
+ "deserializedAs": {}
+ }
+ }
+]
\ No newline at end of file
diff --git a/test/protocol-tests-core/src/main/resources/software/amazon/awssdk/protocol/suites/smithy-rpcv2-suite.json b/test/protocol-tests-core/src/main/resources/software/amazon/awssdk/protocol/suites/smithy-rpcv2-suite.json
new file mode 100644
index 000000000000..a930cd475534
--- /dev/null
+++ b/test/protocol-tests-core/src/main/resources/software/amazon/awssdk/protocol/suites/smithy-rpcv2-suite.json
@@ -0,0 +1,6 @@
+{
+ "testCases": [
+ "cases/smithy-rpcv2-input.json",
+ "cases/smithy-rpcv2-output.json"
+ ]
+}
diff --git a/test/protocol-tests/pom.xml b/test/protocol-tests/pom.xml
index 0281e03e1279..43b11f067ced 100644
--- a/test/protocol-tests/pom.xml
+++ b/test/protocol-tests/pom.xml
@@ -57,13 +57,11 @@
aws-xml-protocol${awsjavasdk.version}
-
software.amazon.awssdkprotocol-core
diff --git a/test/protocol-tests/src/main/resources/codegen-resources/rpcv2/customization.config b/test/protocol-tests/src/main/resources/codegen-resources/rpcv2/customization.config
new file mode 100644
index 000000000000..ec7c8d355d50
--- /dev/null
+++ b/test/protocol-tests/src/main/resources/codegen-resources/rpcv2/customization.config
@@ -0,0 +1,3 @@
+{
+ "skipEndpointTestGeneration": true
+}
diff --git a/test/protocol-tests/src/main/resources/codegen-resources/rpcv2/endpoint-rule-set.json b/test/protocol-tests/src/main/resources/codegen-resources/rpcv2/endpoint-rule-set.json
new file mode 100644
index 000000000000..5846e263b355
--- /dev/null
+++ b/test/protocol-tests/src/main/resources/codegen-resources/rpcv2/endpoint-rule-set.json
@@ -0,0 +1,59 @@
+{
+ "version": "1.3",
+ "parameters": {
+ "Region": {
+ "builtIn": "AWS::Region",
+ "required": true,
+ "documentation": "The AWS region used to dispatch the request.",
+ "type": "String"
+ },
+ "UseDualStack": {
+ "builtIn": "AWS::UseDualStack",
+ "required": true,
+ "default": false,
+ "documentation": "When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.",
+ "type": "Boolean"
+ },
+ "UseFIPS": {
+ "builtIn": "AWS::UseFIPS",
+ "required": true,
+ "default": false,
+ "documentation": "When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.",
+ "type": "Boolean"
+ },
+ "Endpoint": {
+ "builtIn": "SDK::Endpoint",
+ "required": false,
+ "documentation": "Override the endpoint used to send this request",
+ "type": "String"
+ }
+ },
+ "rules": [
+ {
+ "conditions": [
+ ],
+ "type": "tree",
+ "rules": [
+ {
+ "conditions": [],
+ "endpoint": {
+ "url": {
+ "ref": "Endpoint"
+ },
+ "properties": {
+ "authSchemes": [
+ {
+ "name": "sigv4",
+ "signingRegion": "{Region}",
+ "signingName": "jsonrpc"
+ }
+ ]
+ },
+ "headers": {}
+ },
+ "type": "endpoint"
+ }
+ ]
+ }
+ ]
+}
diff --git a/test/protocol-tests/src/main/resources/codegen-resources/rpcv2/endpoint-tests.json b/test/protocol-tests/src/main/resources/codegen-resources/rpcv2/endpoint-tests.json
new file mode 100644
index 000000000000..f94902ff9d99
--- /dev/null
+++ b/test/protocol-tests/src/main/resources/codegen-resources/rpcv2/endpoint-tests.json
@@ -0,0 +1,5 @@
+{
+ "testCases": [
+ ],
+ "version": "1.0"
+}
\ No newline at end of file
diff --git a/test/protocol-tests/src/main/resources/codegen-resources/rpcv2/service-2.json b/test/protocol-tests/src/main/resources/codegen-resources/rpcv2/service-2.json
new file mode 100644
index 000000000000..0cc5eeb51db6
--- /dev/null
+++ b/test/protocol-tests/src/main/resources/codegen-resources/rpcv2/service-2.json
@@ -0,0 +1,546 @@
+{
+ "version":"2.0",
+ "metadata":{
+ "apiVersion":"2023-03-10",
+ "auth":["aws.auth#sigv4"],
+ "endpointPrefix":"smithyrpcv2protocol",
+ "protocol":"smithy-rpc-v2-cbor",
+ "protocols":["smithy-rpc-v2-cbor"],
+ "serviceFullName":"RpcV2 Protocol Service",
+ "serviceId":"SmithyRpcV2Protocol",
+ "signatureVersion":"v4",
+ "signingName":"execute-api",
+ "targetPrefix":"RpcV2Protocol",
+ "uid":"smithy-rpcv2protocol-2023-03-10"
+ },
+ "operations":{
+ "EmptyInputOutput":{
+ "name":"EmptyInputOutput",
+ "http":{
+ "method":"POST",
+ "requestUri":"/"
+ },
+ "input":{"shape":"EmptyStructure"},
+ "output":{"shape":"EmptyStructure"}
+ },
+ "Float16":{
+ "name":"Float16",
+ "http":{
+ "method":"POST",
+ "requestUri":"/"
+ },
+ "output":{"shape":"Float16Output"}
+ },
+ "FractionalSeconds":{
+ "name":"FractionalSeconds",
+ "http":{
+ "method":"POST",
+ "requestUri":"/"
+ },
+ "output":{"shape":"FractionalSecondsOutput"}
+ },
+ "GreetingWithErrors":{
+ "name":"GreetingWithErrors",
+ "http":{
+ "method":"POST",
+ "requestUri":"/"
+ },
+ "output":{"shape":"GreetingWithErrorsOutput"},
+ "errors":[
+ {"shape":"ComplexError"},
+ {"shape":"InvalidGreeting"}
+ ],
+ "idempotent":true
+ },
+ "NoInputOutput":{
+ "name":"NoInputOutput",
+ "http":{
+ "method":"POST",
+ "requestUri":"/"
+ }
+ },
+ "OperationWithDefaults":{
+ "name":"OperationWithDefaults",
+ "http":{
+ "method":"POST",
+ "requestUri":"/"
+ },
+ "input":{"shape":"OperationWithDefaultsInput"},
+ "output":{"shape":"OperationWithDefaultsOutput"},
+ "errors":[
+ {"shape":"ValidationException"}
+ ]
+ },
+ "OptionalInputOutput":{
+ "name":"OptionalInputOutput",
+ "http":{
+ "method":"POST",
+ "requestUri":"/"
+ },
+ "input":{"shape":"SimpleStructure"},
+ "output":{"shape":"SimpleStructure"}
+ },
+ "RecursiveShapes":{
+ "name":"RecursiveShapes",
+ "http":{
+ "method":"POST",
+ "requestUri":"/"
+ },
+ "input":{"shape":"RecursiveShapesInputOutput"},
+ "output":{"shape":"RecursiveShapesInputOutput"}
+ },
+ "RpcV2CborDenseMaps":{
+ "name":"RpcV2CborDenseMaps",
+ "http":{
+ "method":"POST",
+ "requestUri":"/"
+ },
+ "input":{"shape":"RpcV2CborDenseMapsInputOutput"},
+ "output":{"shape":"RpcV2CborDenseMapsInputOutput"},
+ "errors":[
+ {"shape":"ValidationException"}
+ ]
+ },
+ "RpcV2CborLists":{
+ "name":"RpcV2CborLists",
+ "http":{
+ "method":"POST",
+ "requestUri":"/"
+ },
+ "input":{"shape":"RpcV2CborListInputOutput"},
+ "output":{"shape":"RpcV2CborListInputOutput"},
+ "errors":[
+ {"shape":"ValidationException"}
+ ],
+ "idempotent":true
+ },
+ "RpcV2CborSparseMaps":{
+ "name":"RpcV2CborSparseMaps",
+ "http":{
+ "method":"POST",
+ "requestUri":"/"
+ },
+ "input":{"shape":"RpcV2CborSparseMapsInputOutput"},
+ "output":{"shape":"RpcV2CborSparseMapsInputOutput"},
+ "errors":[
+ {"shape":"ValidationException"}
+ ]
+ },
+ "SimpleScalarProperties":{
+ "name":"SimpleScalarProperties",
+ "http":{
+ "method":"POST",
+ "requestUri":"/"
+ },
+ "input":{"shape":"SimpleScalarStructure"},
+ "output":{"shape":"SimpleScalarStructure"}
+ },
+ "SparseNullsOperation":{
+ "name":"SparseNullsOperation",
+ "http":{
+ "method":"POST",
+ "requestUri":"/"
+ },
+ "input":{"shape":"SparseNullsOperationInputOutput"},
+ "output":{"shape":"SparseNullsOperationInputOutput"}
+ }
+ },
+ "shapes":{
+ "Blob":{"type":"blob"},
+ "BlobList":{
+ "type":"list",
+ "member":{"shape":"Blob"}
+ },
+ "Boolean":{
+ "type":"boolean",
+ "box":true
+ },
+ "BooleanList":{
+ "type":"list",
+ "member":{"shape":"Boolean"}
+ },
+ "Byte":{
+ "type":"byte",
+ "box":true
+ },
+ "ClientOptionalDefaults":{
+ "type":"structure",
+ "members":{
+ "member":{"shape":"Integer"}
+ }
+ },
+ "ComplexError":{
+ "type":"structure",
+ "members":{
+ "TopLevel":{"shape":"String"},
+ "Nested":{"shape":"ComplexNestedErrorData"}
+ },
+ "exception":true
+ },
+ "ComplexNestedErrorData":{
+ "type":"structure",
+ "members":{
+ "Foo":{"shape":"String"}
+ }
+ },
+ "DateTime":{
+ "type":"timestamp"
+ },
+ "Defaults":{
+ "type":"structure",
+ "members":{
+ "defaultString":{"shape":"String"},
+ "defaultBoolean":{"shape":"Boolean"},
+ "defaultList":{"shape":"TestStringList"},
+ "defaultTimestamp":{"shape":"Timestamp"},
+ "defaultBlob":{"shape":"Blob"},
+ "defaultByte":{"shape":"Byte"},
+ "defaultShort":{"shape":"Short"},
+ "defaultInteger":{"shape":"Integer"},
+ "defaultLong":{"shape":"Long"},
+ "defaultFloat":{"shape":"Float"},
+ "defaultDouble":{"shape":"Double"},
+ "defaultMap":{"shape":"TestStringMap"},
+ "defaultEnum":{"shape":"TestEnum"},
+ "defaultIntEnum":{"shape":"TestIntEnum"},
+ "emptyString":{"shape":"String"},
+ "falseBoolean":{"shape":"Boolean"},
+ "emptyBlob":{"shape":"Blob"},
+ "zeroByte":{"shape":"Byte"},
+ "zeroShort":{"shape":"Short"},
+ "zeroInteger":{"shape":"Integer"},
+ "zeroLong":{"shape":"Long"},
+ "zeroFloat":{"shape":"Float"},
+ "zeroDouble":{"shape":"Double"}
+ }
+ },
+ "DenseBooleanMap":{
+ "type":"map",
+ "key":{"shape":"String"},
+ "value":{"shape":"Boolean"}
+ },
+ "DenseNumberMap":{
+ "type":"map",
+ "key":{"shape":"String"},
+ "value":{"shape":"Integer"}
+ },
+ "DenseSetMap":{
+ "type":"map",
+ "key":{"shape":"String"},
+ "value":{"shape":"StringSet"}
+ },
+ "DenseStringMap":{
+ "type":"map",
+ "key":{"shape":"String"},
+ "value":{"shape":"String"}
+ },
+ "DenseStructMap":{
+ "type":"map",
+ "key":{"shape":"String"},
+ "value":{"shape":"GreetingStruct"}
+ },
+ "Double":{
+ "type":"double",
+ "box":true
+ },
+ "EmptyStructure":{
+ "type":"structure",
+ "members":{
+ }
+ },
+ "Float":{
+ "type":"float",
+ "box":true
+ },
+ "Float16Output":{
+ "type":"structure",
+ "members":{
+ "value":{"shape":"Double"}
+ }
+ },
+ "FooEnum":{
+ "type":"string",
+ "enum":[
+ "Foo",
+ "Baz",
+ "Bar"
+ ]
+ },
+ "FooEnumList":{
+ "type":"list",
+ "member":{"shape":"FooEnum"}
+ },
+ "FractionalSecondsOutput":{
+ "type":"structure",
+ "members":{
+ "datetime":{"shape":"DateTime"}
+ }
+ },
+ "GreetingStruct":{
+ "type":"structure",
+ "members":{
+ "hi":{"shape":"String"}
+ }
+ },
+ "GreetingWithErrorsOutput":{
+ "type":"structure",
+ "members":{
+ "greeting":{"shape":"String"}
+ }
+ },
+ "Integer":{
+ "type":"integer",
+ "box":true
+ },
+ "IntegerEnum":{
+ "type":"integer",
+ "box":true
+ },
+ "IntegerEnumList":{
+ "type":"list",
+ "member":{"shape":"IntegerEnum"}
+ },
+ "IntegerList":{
+ "type":"list",
+ "member":{"shape":"Integer"}
+ },
+ "InvalidGreeting":{
+ "type":"structure",
+ "members":{
+ "Message":{"shape":"String"}
+ },
+ "exception":true
+ },
+ "Long":{
+ "type":"long",
+ "box":true
+ },
+ "NestedStringList":{
+ "type":"list",
+ "member":{"shape":"StringList"}
+ },
+ "OperationWithDefaultsInput":{
+ "type":"structure",
+ "members":{
+ "defaults":{"shape":"Defaults"},
+ "clientOptionalDefaults":{"shape":"ClientOptionalDefaults"},
+ "topLevelDefault":{"shape":"String"},
+ "otherTopLevelDefault":{"shape":"Integer"}
+ }
+ },
+ "OperationWithDefaultsOutput":{
+ "type":"structure",
+ "members":{
+ "defaultString":{"shape":"String"},
+ "defaultBoolean":{"shape":"Boolean"},
+ "defaultList":{"shape":"TestStringList"},
+ "defaultTimestamp":{"shape":"Timestamp"},
+ "defaultBlob":{"shape":"Blob"},
+ "defaultByte":{"shape":"Byte"},
+ "defaultShort":{"shape":"Short"},
+ "defaultInteger":{"shape":"Integer"},
+ "defaultLong":{"shape":"Long"},
+ "defaultFloat":{"shape":"Float"},
+ "defaultDouble":{"shape":"Double"},
+ "defaultMap":{"shape":"TestStringMap"},
+ "defaultEnum":{"shape":"TestEnum"},
+ "defaultIntEnum":{"shape":"TestIntEnum"},
+ "emptyString":{"shape":"String"},
+ "falseBoolean":{"shape":"Boolean"},
+ "emptyBlob":{"shape":"Blob"},
+ "zeroByte":{"shape":"Byte"},
+ "zeroShort":{"shape":"Short"},
+ "zeroInteger":{"shape":"Integer"},
+ "zeroLong":{"shape":"Long"},
+ "zeroFloat":{"shape":"Float"},
+ "zeroDouble":{"shape":"Double"}
+ }
+ },
+ "RecursiveShapesInputOutput":{
+ "type":"structure",
+ "members":{
+ "nested":{"shape":"RecursiveShapesInputOutputNested1"}
+ }
+ },
+ "RecursiveShapesInputOutputNested1":{
+ "type":"structure",
+ "members":{
+ "foo":{"shape":"String"},
+ "nested":{"shape":"RecursiveShapesInputOutputNested2"}
+ }
+ },
+ "RecursiveShapesInputOutputNested2":{
+ "type":"structure",
+ "members":{
+ "bar":{"shape":"String"},
+ "recursiveMember":{"shape":"RecursiveShapesInputOutputNested1"}
+ }
+ },
+ "RpcV2CborDenseMapsInputOutput":{
+ "type":"structure",
+ "members":{
+ "denseStructMap":{"shape":"DenseStructMap"},
+ "denseNumberMap":{"shape":"DenseNumberMap"},
+ "denseBooleanMap":{"shape":"DenseBooleanMap"},
+ "denseStringMap":{"shape":"DenseStringMap"},
+ "denseSetMap":{"shape":"DenseSetMap"}
+ }
+ },
+ "RpcV2CborListInputOutput":{
+ "type":"structure",
+ "members":{
+ "stringList":{"shape":"StringList"},
+ "stringSet":{"shape":"StringSet"},
+ "integerList":{"shape":"IntegerList"},
+ "booleanList":{"shape":"BooleanList"},
+ "timestampList":{"shape":"TimestampList"},
+ "enumList":{"shape":"FooEnumList"},
+ "intEnumList":{"shape":"IntegerEnumList"},
+ "nestedStringList":{"shape":"NestedStringList"},
+ "structureList":{"shape":"StructureList"},
+ "blobList":{"shape":"BlobList"}
+ }
+ },
+ "RpcV2CborSparseMapsInputOutput":{
+ "type":"structure",
+ "members":{
+ "sparseStructMap":{"shape":"SparseStructMap"},
+ "sparseNumberMap":{"shape":"SparseNumberMap"},
+ "sparseBooleanMap":{"shape":"SparseBooleanMap"},
+ "sparseStringMap":{"shape":"SparseStringMap"},
+ "sparseSetMap":{"shape":"SparseSetMap"}
+ }
+ },
+ "Short":{
+ "type":"short",
+ "box":true
+ },
+ "SimpleScalarStructure":{
+ "type":"structure",
+ "members":{
+ "trueBooleanValue":{"shape":"Boolean"},
+ "falseBooleanValue":{"shape":"Boolean"},
+ "byteValue":{"shape":"Byte"},
+ "doubleValue":{"shape":"Double"},
+ "floatValue":{"shape":"Float"},
+ "integerValue":{"shape":"Integer"},
+ "longValue":{"shape":"Long"},
+ "shortValue":{"shape":"Short"},
+ "stringValue":{"shape":"String"},
+ "blobValue":{"shape":"Blob"}
+ }
+ },
+ "SimpleStructure":{
+ "type":"structure",
+ "members":{
+ "value":{"shape":"String"}
+ }
+ },
+ "SparseBooleanMap":{
+ "type":"map",
+ "key":{"shape":"String"},
+ "value":{"shape":"Boolean"}
+ },
+ "SparseNullsOperationInputOutput":{
+ "type":"structure",
+ "members":{
+ "sparseStringList":{"shape":"SparseStringList"},
+ "sparseStringMap":{"shape":"SparseStringMap"}
+ }
+ },
+ "SparseNumberMap":{
+ "type":"map",
+ "key":{"shape":"String"},
+ "value":{"shape":"Integer"}
+ },
+ "SparseSetMap":{
+ "type":"map",
+ "key":{"shape":"String"},
+ "value":{"shape":"StringSet"}
+ },
+ "SparseStringList":{
+ "type":"list",
+ "member":{"shape":"String"}
+ },
+ "SparseStringMap":{
+ "type":"map",
+ "key":{"shape":"String"},
+ "value":{"shape":"String"}
+ },
+ "SparseStructMap":{
+ "type":"map",
+ "key":{"shape":"String"},
+ "value":{"shape":"GreetingStruct"}
+ },
+ "String":{"type":"string"},
+ "StringList":{
+ "type":"list",
+ "member":{"shape":"String"}
+ },
+ "StringSet":{
+ "type":"list",
+ "member":{"shape":"String"}
+ },
+ "StructureList":{
+ "type":"list",
+ "member":{"shape":"StructureListMember"}
+ },
+ "StructureListMember":{
+ "type":"structure",
+ "members":{
+ "a":{"shape":"String"},
+ "b":{"shape":"String"}
+ }
+ },
+ "TestEnum":{
+ "type":"string",
+ "enum":[
+ "FOO",
+ "BAR",
+ "BAZ"
+ ]
+ },
+ "TestIntEnum":{
+ "type":"integer",
+ "box":true
+ },
+ "TestStringList":{
+ "type":"list",
+ "member":{"shape":"String"}
+ },
+ "TestStringMap":{
+ "type":"map",
+ "key":{"shape":"String"},
+ "value":{"shape":"String"}
+ },
+ "Timestamp":{"type":"timestamp"},
+ "TimestampList":{
+ "type":"list",
+ "member":{"shape":"Timestamp"}
+ },
+ "ValidationException":{
+ "type":"structure",
+ "required":["message"],
+ "members":{
+ "message":{"shape":"String"},
+ "fieldList":{"shape":"ValidationExceptionFieldList"}
+ },
+ "exception":true
+ },
+ "ValidationExceptionField":{
+ "type":"structure",
+ "required":[
+ "path",
+ "message"
+ ],
+ "members":{
+ "path":{"shape":"String"},
+ "message":{"shape":"String"}
+ }
+ },
+ "ValidationExceptionFieldList":{
+ "type":"list",
+ "member":{"shape":"ValidationExceptionField"}
+ }
+ }
+}
diff --git a/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/SmithyRpcV2CborProtocolTest.java b/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/SmithyRpcV2CborProtocolTest.java
new file mode 100644
index 000000000000..96bdb7edaeb4
--- /dev/null
+++ b/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/SmithyRpcV2CborProtocolTest.java
@@ -0,0 +1,51 @@
+/*
+ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://aws.amazon.com/apache2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package software.amazon.awssdk.protocol.tests;
+
+import java.io.IOException;
+import java.util.List;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import software.amazon.awssdk.protocol.ProtocolTestSuiteLoader;
+import software.amazon.awssdk.protocol.model.TestCase;
+import software.amazon.awssdk.protocol.runners.ProtocolTestRunner;
+
+@RunWith(Parameterized.class)
+public class SmithyRpcV2CborProtocolTest {
+
+ private static final ProtocolTestSuiteLoader TEST_SUITE_LOADER = new ProtocolTestSuiteLoader();
+ private static ProtocolTestRunner testRunner;
+
+ @Parameterized.Parameter
+ public TestCase testCase;
+
+ @Parameterized.Parameters(name = "{0}")
+ public static List data() throws IOException {
+ return TEST_SUITE_LOADER.load("smithy-rpcv2-suite.json");
+ }
+
+ @BeforeClass
+ public static void setupFixture() {
+ testRunner = new ProtocolTestRunner("/models/smithyrpcv2protocol-2023-03-10-intermediate.json");
+ }
+
+ @Test
+ public void runProtocolTest() throws Exception {
+ testRunner.runTest(testCase);
+ }
+}
From ea61e301c83b43daa09785db890b3cb51ffc9ba7 Mon Sep 17 00:00:00 2001
From: Manuel Sugawara
Date: Fri, 16 Aug 2024 12:35:53 -0700
Subject: [PATCH 07/18] Support for operation without input defined (#5512)
* Support for operation without input defined
* Fix a checkstyle issue
* Code clean up
* Code clean up 2
* Rewrite the condition to conjunctive normal form
---
.../awssdk/codegen/AddEmptyInputShape.java | 4 +-
.../DefaultProtocolMetadataConstants.java | 51 ++++++++
.../internal/ProtocolMetadataConstants.java | 51 ++++++++
.../internal/ProtocolMetadataDefault.java | 72 +++++++++++
.../amazon/awssdk/codegen/internal/Utils.java | 18 +--
.../model/intermediate/ShapeMarshaller.java | 29 +++--
.../protocols/CodegenSerializer.java | 113 ++++++++++++++++++
.../protocols/CodegenSerializerResolver.java | 55 +++++++++
.../protocols/JsonMarshallerSpec.java | 58 ++++++++-
.../json/BaseAwsJsonProtocolFactory.java | 24 +++-
.../marshall/JsonProtocolMarshaller.java | 8 +-
.../core/OperationMetadataAttribute.java | 20 +++-
.../suites/cases/smithy-rpcv2-input.json | 36 +++++-
13 files changed, 498 insertions(+), 41 deletions(-)
create mode 100644 codegen/src/main/java/software/amazon/awssdk/codegen/internal/DefaultProtocolMetadataConstants.java
create mode 100644 codegen/src/main/java/software/amazon/awssdk/codegen/internal/ProtocolMetadataConstants.java
create mode 100644 codegen/src/main/java/software/amazon/awssdk/codegen/internal/ProtocolMetadataDefault.java
create mode 100644 codegen/src/main/java/software/amazon/awssdk/codegen/poet/transform/protocols/CodegenSerializer.java
create mode 100644 codegen/src/main/java/software/amazon/awssdk/codegen/poet/transform/protocols/CodegenSerializerResolver.java
diff --git a/codegen/src/main/java/software/amazon/awssdk/codegen/AddEmptyInputShape.java b/codegen/src/main/java/software/amazon/awssdk/codegen/AddEmptyInputShape.java
index 3b1c95677796..fcb5c46a7e50 100644
--- a/codegen/src/main/java/software/amazon/awssdk/codegen/AddEmptyInputShape.java
+++ b/codegen/src/main/java/software/amazon/awssdk/codegen/AddEmptyInputShape.java
@@ -15,7 +15,7 @@
package software.amazon.awssdk.codegen;
-import static software.amazon.awssdk.codegen.internal.Utils.createInputShapeMarshaller;
+import static software.amazon.awssdk.codegen.internal.Utils.createSyntheticInputShapeMarshaller;
import static software.amazon.awssdk.codegen.internal.Utils.unCapitalize;
import java.util.HashMap;
@@ -75,7 +75,7 @@ private Map addEmptyInputShapes(
shape.setVariable(inputVariable);
shape.setMarshaller(
- createInputShapeMarshaller(serviceModel.getMetadata(), operation));
+ createSyntheticInputShapeMarshaller(serviceModel.getMetadata(), operation));
emptyInputShapes.put(inputShape, shape);
diff --git a/codegen/src/main/java/software/amazon/awssdk/codegen/internal/DefaultProtocolMetadataConstants.java b/codegen/src/main/java/software/amazon/awssdk/codegen/internal/DefaultProtocolMetadataConstants.java
new file mode 100644
index 000000000000..7c9bf84f9c95
--- /dev/null
+++ b/codegen/src/main/java/software/amazon/awssdk/codegen/internal/DefaultProtocolMetadataConstants.java
@@ -0,0 +1,51 @@
+/*
+ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://aws.amazon.com/apache2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package software.amazon.awssdk.codegen.internal;
+
+import java.util.AbstractMap;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.stream.Collectors;
+import software.amazon.awssdk.protocols.core.OperationMetadataAttribute;
+import software.amazon.awssdk.utils.AttributeMap;
+
+/**
+ * Default implementation of {@link ProtocolMetadataConstants}.
+ */
+public final class DefaultProtocolMetadataConstants implements ProtocolMetadataConstants {
+ private final Set, OperationMetadataAttribute>>> knownKeys = new LinkedHashSet<>();
+ private final AttributeMap.Builder map = AttributeMap.builder();
+
+ @Override
+ public List, OperationMetadataAttribute>>> keys() {
+ return knownKeys.stream().filter(x -> map.get(x.getValue()) != null).collect(Collectors.toList());
+ }
+
+ @Override
+ public T put(Class> containingClass, OperationMetadataAttribute key, T value) {
+ knownKeys.add(new AbstractMap.SimpleEntry<>(containingClass, key));
+ T oldValue = map.get(key);
+ map.put(key, value);
+ return oldValue;
+ }
+
+ @Override
+ public T get(OperationMetadataAttribute key) {
+ return map.get(key);
+ }
+}
diff --git a/codegen/src/main/java/software/amazon/awssdk/codegen/internal/ProtocolMetadataConstants.java b/codegen/src/main/java/software/amazon/awssdk/codegen/internal/ProtocolMetadataConstants.java
new file mode 100644
index 000000000000..2384ca7977ca
--- /dev/null
+++ b/codegen/src/main/java/software/amazon/awssdk/codegen/internal/ProtocolMetadataConstants.java
@@ -0,0 +1,51 @@
+/*
+ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://aws.amazon.com/apache2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package software.amazon.awssdk.codegen.internal;
+
+import java.util.List;
+import java.util.Map;
+import software.amazon.awssdk.protocols.core.OperationMetadataAttribute;
+
+/**
+ * Keeps the set of {@link OperationMetadataAttribute} constants attributes per operation/protocol. This is used to codegen
+ * those constant values.
+ */
+public interface ProtocolMetadataConstants {
+
+ /**
+ * Returns the list of keys sets. The {@link Map.Entry} contains as key the class containing the key field and the value
+ * contains the key constant itself. The class is needed to properly codegen a reference to the key.
+ * @return
+ */
+ List, OperationMetadataAttribute>>> keys();
+
+ /**
+ * Adds an operation metadata to the set of constants.
+ */
+ T put(Class> containingClass, OperationMetadataAttribute key, T value);
+
+ /**
+ * Adds an operation metadata to the set of constants.
+ */
+ default T put(OperationMetadataAttribute key, T value) {
+ return put(key.getClass(), key, value);
+ }
+
+ /**
+ * Gets the constant value for the operation metadata key.
+ */
+ T get(OperationMetadataAttribute key);
+}
diff --git a/codegen/src/main/java/software/amazon/awssdk/codegen/internal/ProtocolMetadataDefault.java b/codegen/src/main/java/software/amazon/awssdk/codegen/internal/ProtocolMetadataDefault.java
new file mode 100644
index 000000000000..ca7c346bd19c
--- /dev/null
+++ b/codegen/src/main/java/software/amazon/awssdk/codegen/internal/ProtocolMetadataDefault.java
@@ -0,0 +1,72 @@
+/*
+ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://aws.amazon.com/apache2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package software.amazon.awssdk.codegen.internal;
+
+import software.amazon.awssdk.codegen.model.intermediate.Protocol;
+import software.amazon.awssdk.codegen.model.intermediate.ShapeMarshaller;
+import software.amazon.awssdk.protocols.json.BaseAwsJsonProtocolFactory;
+import software.amazon.awssdk.utils.MapUtils;
+
+/**
+ * Enum that maps protocol to metadata attribute constants for a given operation.
+ */
+public enum ProtocolMetadataDefault {
+
+ SMITHY_RPC_V2_CBOR(Protocol.SMITHY_RPC_V2_CBOR) {
+ public ProtocolMetadataConstants protocolMetadata(ShapeMarshaller shapeMarshaller) {
+ ProtocolMetadataConstants attributes = new DefaultProtocolMetadataConstants();
+
+ // Smithy RPCv2 requires the header "smithy-protocol" with value "rpc-v2-cbor"
+ // See https://smithy.io/2.0/additional-specs/protocols/smithy-rpc-v2.html#requests.
+ attributes.put(BaseAwsJsonProtocolFactory.class,
+ BaseAwsJsonProtocolFactory.HTTP_EXTRA_HEADERS,
+ MapUtils.of("smithy-protocol", "rpc-v2-cbor"));
+
+ // If the shape is synthetic that means that no-input was defined in the model. For this
+ // case the protocol requires to send an empty body with no content-type. See
+ // https://smithy.io/2.0/additional-specs/protocols/smithy-rpc-v2.html#requests.
+ // To accomplish this we use a no-op JSON generator. Otherwise, we serialize the input
+ // even when no members are defined.
+ attributes.put(BaseAwsJsonProtocolFactory.class,
+ BaseAwsJsonProtocolFactory.USE_NO_OP_GENERATOR,
+ shapeMarshaller.getIsSynthetic());
+ return attributes;
+ }
+ },
+ DEFAULT(null);
+
+ private final Protocol protocol;
+
+ ProtocolMetadataDefault(Protocol protocol) {
+ this.protocol = protocol;
+ }
+
+ /**
+ * Returns a function that maps from a {@link ShapeMarshaller} to a set of protocol metadata constants that we codegen.
+ */
+ public ProtocolMetadataConstants protocolMetadata(ShapeMarshaller shapeMarshaller) {
+ return new DefaultProtocolMetadataConstants();
+ }
+
+ public static ProtocolMetadataDefault from(Protocol protocol) {
+ for (ProtocolMetadataDefault value : values()) {
+ if (value.protocol == protocol) {
+ return value;
+ }
+ }
+ return DEFAULT;
+ }
+}
diff --git a/codegen/src/main/java/software/amazon/awssdk/codegen/internal/Utils.java b/codegen/src/main/java/software/amazon/awssdk/codegen/internal/Utils.java
index 9184d096d55b..8a2f490bcd36 100644
--- a/codegen/src/main/java/software/amazon/awssdk/codegen/internal/Utils.java
+++ b/codegen/src/main/java/software/amazon/awssdk/codegen/internal/Utils.java
@@ -29,7 +29,6 @@
import software.amazon.awssdk.codegen.model.intermediate.MapModel;
import software.amazon.awssdk.codegen.model.intermediate.MemberModel;
import software.amazon.awssdk.codegen.model.intermediate.Metadata;
-import software.amazon.awssdk.codegen.model.intermediate.Protocol;
import software.amazon.awssdk.codegen.model.intermediate.ShapeMarshaller;
import software.amazon.awssdk.codegen.model.intermediate.ShapeModel;
import software.amazon.awssdk.codegen.model.intermediate.ShapeType;
@@ -335,7 +334,7 @@ public static ShapeMarshaller createInputShapeMarshaller(ServiceMetadata service
.withAction(operation.getName())
.withVerb(operation.getHttp().getMethod())
.withRequestUri(operation.getHttp().getRequestUri())
- .withSmithyProtocol(getSmithyProtocol(service.getProtocol()));
+ .withProtocol(service.getProtocol());
Input input = operation.getInput();
if (input != null) {
marshaller.setLocationName(input.getLocationName());
@@ -354,12 +353,13 @@ public static ShapeMarshaller createInputShapeMarshaller(ServiceMetadata service
}
- private static String getSmithyProtocol(String protocol) {
- switch (Protocol.fromValue(protocol)) {
- case SMITHY_RPC_V2_CBOR:
- return "rpc-v2-cbor";
- default:
- return null;
- }
+ /**
+ * Create the ShapeMarshaller to the input shape from the specified Operation.
+ * The input shape in the operation could be empty.
+ */
+ public static ShapeMarshaller createSyntheticInputShapeMarshaller(ServiceMetadata service, Operation operation) {
+ ShapeMarshaller result = createInputShapeMarshaller(service, operation);
+ result.withIsSynthetic(true);
+ return result;
}
}
diff --git a/codegen/src/main/java/software/amazon/awssdk/codegen/model/intermediate/ShapeMarshaller.java b/codegen/src/main/java/software/amazon/awssdk/codegen/model/intermediate/ShapeMarshaller.java
index 18d8d735908f..924e45d5b31d 100644
--- a/codegen/src/main/java/software/amazon/awssdk/codegen/model/intermediate/ShapeMarshaller.java
+++ b/codegen/src/main/java/software/amazon/awssdk/codegen/model/intermediate/ShapeMarshaller.java
@@ -29,7 +29,9 @@ public class ShapeMarshaller {
private String xmlNameSpaceUri;
- private String smithyProtocol;
+ private Boolean isSynthetic = Boolean.FALSE;
+
+ private String protocol;
public String getAction() {
return action;
@@ -109,16 +111,29 @@ public ShapeMarshaller withXmlNameSpaceUri(String xmlNameSpaceUri) {
return this;
}
- public String getSmithyProtocol() {
- return smithyProtocol;
+ public Boolean getIsSynthetic() {
+ return isSynthetic;
+ }
+
+ public void setIsSynthetic(Boolean isSynthetic) {
+ this.isSynthetic = isSynthetic;
+ }
+
+ public ShapeMarshaller withIsSynthetic(Boolean isSynthetic) {
+ setIsSynthetic(isSynthetic);
+ return this;
+ }
+
+ public String getProtocol() {
+ return protocol;
}
- public void setSmithyProtocol(String smithyProtocol) {
- this.smithyProtocol = smithyProtocol;
+ public void setProtocol(String protocol) {
+ this.protocol = protocol;
}
- public ShapeMarshaller withSmithyProtocol(String smithyProtocol) {
- setSmithyProtocol(smithyProtocol);
+ public ShapeMarshaller withProtocol(String protocol) {
+ setProtocol(protocol);
return this;
}
}
diff --git a/codegen/src/main/java/software/amazon/awssdk/codegen/poet/transform/protocols/CodegenSerializer.java b/codegen/src/main/java/software/amazon/awssdk/codegen/poet/transform/protocols/CodegenSerializer.java
new file mode 100644
index 000000000000..035ffe059742
--- /dev/null
+++ b/codegen/src/main/java/software/amazon/awssdk/codegen/poet/transform/protocols/CodegenSerializer.java
@@ -0,0 +1,113 @@
+/*
+ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://aws.amazon.com/apache2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package software.amazon.awssdk.codegen.poet.transform.protocols;
+
+import com.squareup.javapoet.CodeBlock;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+import software.amazon.awssdk.utils.MapUtils;
+
+/**
+ * Encapsulates the codegen serialization logic for the given value.
+ */
+public interface CodegenSerializer {
+ /**
+ * Creates a codegen serialization for the given value using the {@link CodeBlock.Builder}.
+ */
+ void serialize(T value, CodeBlock.Builder builder);
+
+ /**
+ * Codegen for String values.
+ */
+ class CodegenStringSerializer implements CodegenSerializer {
+
+ @Override
+ public void serialize(String value, CodeBlock.Builder builder) {
+ builder.add("$S", value);
+ }
+ }
+
+ /**
+ * Codegen for literal values.
+ */
+ class CodegenLiteralSerializer implements CodegenSerializer