diff --git a/.changes/next-release/feature-AWSSDKforJavav2-6c20b9b.json b/.changes/next-release/feature-AWSSDKforJavav2-6c20b9b.json new file mode 100644 index 000000000000..f5499cf0e20f --- /dev/null +++ b/.changes/next-release/feature-AWSSDKforJavav2-6c20b9b.json @@ -0,0 +1,6 @@ +{ + "category": "AWS SDK for Java v2", + "contributor": "", + "type": "feature", + "description": "Extend union type improvements to additional services: dynamodb, dynamodbstreams, iot, sagemaker, clouddirectory, iotanalytics, kendra, marketplaceentitlement, quicksight, s3, xray." +} diff --git a/codegen/src/main/java/software/amazon/awssdk/codegen/customization/processors/ShapeModifiersProcessor.java b/codegen/src/main/java/software/amazon/awssdk/codegen/customization/processors/ShapeModifiersProcessor.java index 9e371bc6b29b..d4e1b02d5639 100644 --- a/codegen/src/main/java/software/amazon/awssdk/codegen/customization/processors/ShapeModifiersProcessor.java +++ b/codegen/src/main/java/software/amazon/awssdk/codegen/customization/processors/ShapeModifiersProcessor.java @@ -204,6 +204,10 @@ private void preprocessModifyShapeMembers(ServiceModel serviceModel, Shape shape shape.getMembers().putAll(injects); } } + + if (modifier.isUnion() != null) { + shape.setUnion(modifier.isUnion()); + } } private void doModifyShapeMembers(ServiceModel serviceModel, Shape shape, String memberToModify, diff --git a/codegen/src/main/java/software/amazon/awssdk/codegen/model/config/customization/ShapeModifier.java b/codegen/src/main/java/software/amazon/awssdk/codegen/model/config/customization/ShapeModifier.java index 2ff84f8f3329..935e6b3f2e32 100644 --- a/codegen/src/main/java/software/amazon/awssdk/codegen/model/config/customization/ShapeModifier.java +++ b/codegen/src/main/java/software/amazon/awssdk/codegen/model/config/customization/ShapeModifier.java @@ -30,6 +30,7 @@ public class ShapeModifier { private List> modify; private List> inject; private Integer staxTargetDepthOffset; + private Boolean union; /** * @return true if the whole shape should be excluded. @@ -87,4 +88,12 @@ public Integer getStaxTargetDepthOffset() { public void setStaxTargetDepthOffset(Integer staxTargetDepthOffset) { this.staxTargetDepthOffset = staxTargetDepthOffset; } + + public Boolean isUnion() { + return union; + } + + public void setUnion(Boolean union) { + this.union = union; + } } diff --git a/services/clouddirectory/src/main/resources/codegen-resources/customization.config b/services/clouddirectory/src/main/resources/codegen-resources/customization.config index 51b6bcd1460d..38cda36ee83a 100644 --- a/services/clouddirectory/src/main/resources/codegen-resources/customization.config +++ b/services/clouddirectory/src/main/resources/codegen-resources/customization.config @@ -4,5 +4,10 @@ "listDirectories", "listManagedSchemaArns", "listPublishedSchemaArns" - ] + ], + "shapeModifiers": { + "TypedAttributeValue": { + "union": true + } + } } diff --git a/services/dynamodb/src/main/resources/codegen-resources/dynamodb/customization.config b/services/dynamodb/src/main/resources/codegen-resources/dynamodb/customization.config index ef3e95c5e70c..43c388445c29 100644 --- a/services/dynamodb/src/main/resources/codegen-resources/dynamodb/customization.config +++ b/services/dynamodb/src/main/resources/codegen-resources/dynamodb/customization.config @@ -8,7 +8,8 @@ "emitPropertyName": "NUL" } } - ] + ], + "union": true } }, "verifiedSimpleMethods" : [ diff --git a/services/dynamodb/src/main/resources/codegen-resources/dynamodbstreams/customization.config b/services/dynamodb/src/main/resources/codegen-resources/dynamodbstreams/customization.config index 41847465bbc3..2d7446a2145b 100644 --- a/services/dynamodb/src/main/resources/codegen-resources/dynamodbstreams/customization.config +++ b/services/dynamodb/src/main/resources/codegen-resources/dynamodbstreams/customization.config @@ -8,7 +8,8 @@ "emitPropertyName": "NUL" } } - ] + ], + "union": true } }, "sdkModeledExceptionBaseClassName": "DynamoDbException", diff --git a/services/iot/src/main/resources/codegen-resources/customization.config b/services/iot/src/main/resources/codegen-resources/customization.config index d2f73f735cdb..9f910afc97f7 100644 --- a/services/iot/src/main/resources/codegen-resources/customization.config +++ b/services/iot/src/main/resources/codegen-resources/customization.config @@ -49,5 +49,10 @@ "DetachPrincipalPolicy", "ListPolicyPrincipals", "ListPrincipalPolicies" - ] + ], + "shapeModifiers": { + "AssetPropertyVariant": { + "union": true + } + } } diff --git a/services/iotanalytics/src/main/resources/codegen-resources/customization.config b/services/iotanalytics/src/main/resources/codegen-resources/customization.config index c9f2858bf193..5837f8c071c6 100644 --- a/services/iotanalytics/src/main/resources/codegen-resources/customization.config +++ b/services/iotanalytics/src/main/resources/codegen-resources/customization.config @@ -7,5 +7,10 @@ ], "blacklistedSimpleMethods": [ "describeLoggingOptions" - ] + ], + "shapeModifiers": { + "DatastoreStorage": { + "union": true + } + } } diff --git a/services/kendra/src/main/resources/codegen-resources/customization.config b/services/kendra/src/main/resources/codegen-resources/customization.config new file mode 100644 index 000000000000..7ed8659b00ff --- /dev/null +++ b/services/kendra/src/main/resources/codegen-resources/customization.config @@ -0,0 +1,7 @@ +{ + "shapeModifiers": { + "DocumentAttributeValue": { + "union": true + } + } +} \ No newline at end of file diff --git a/services/marketplaceentitlement/src/main/resources/codegen-resources/customization.config b/services/marketplaceentitlement/src/main/resources/codegen-resources/customization.config new file mode 100644 index 000000000000..ed0091ae5efb --- /dev/null +++ b/services/marketplaceentitlement/src/main/resources/codegen-resources/customization.config @@ -0,0 +1,7 @@ +{ + "shapeModifiers": { + "EntitlementValue": { + "union": true + } + } +} \ No newline at end of file diff --git a/services/quicksight/src/main/resources/codegen-resources/customization.config b/services/quicksight/src/main/resources/codegen-resources/customization.config index f12a5440b730..cadacf8d10b0 100644 --- a/services/quicksight/src/main/resources/codegen-resources/customization.config +++ b/services/quicksight/src/main/resources/codegen-resources/customization.config @@ -134,6 +134,15 @@ } } ] + }, + "TransformOperation": { + "union": true + }, + "PhysicalTable": { + "union": true + }, + "DataSourceParameters": { + "union": true } } } diff --git a/services/s3/src/main/resources/codegen-resources/customization.config b/services/s3/src/main/resources/codegen-resources/customization.config index 6a887669a059..c289a28e1a90 100644 --- a/services/s3/src/main/resources/codegen-resources/customization.config +++ b/services/s3/src/main/resources/codegen-resources/customization.config @@ -111,6 +111,18 @@ "suffix": { "emitEnumValue": "Suffix" } } ] + }, + "ReplicationRuleFilter": { + "union": true + }, + "MetricsFilter": { + "union": true + }, + "AnalyticsFilter": { + "union": true + }, + "LifecycleRuleFilter": { + "union": true } }, "serviceConfig": { diff --git a/services/sagemaker/src/main/resources/codegen-resources/customization.config b/services/sagemaker/src/main/resources/codegen-resources/customization.config index 9dd066b48e93..dba136e03bb2 100644 --- a/services/sagemaker/src/main/resources/codegen-resources/customization.config +++ b/services/sagemaker/src/main/resources/codegen-resources/customization.config @@ -15,5 +15,10 @@ "listTrainingJobs", "listTransformJobs", "listWorkteams" - ] + ], + "shapeModifiers": { + "TrialComponentParameterValue": { + "union": true + } + } } diff --git a/services/xray/src/main/resources/codegen-resources/customization.config b/services/xray/src/main/resources/codegen-resources/customization.config index 6cb7481da58f..0d2f3c581410 100644 --- a/services/xray/src/main/resources/codegen-resources/customization.config +++ b/services/xray/src/main/resources/codegen-resources/customization.config @@ -8,5 +8,10 @@ "blacklistedSimpleMethods": [ "deleteSamplingRule", "getGroup" - ] + ], + "shapeModifiers": { + "AnnotationValue": { + "union": true + } + } }