Skip to content

Backport union types for pre-smithy services from smithy models into codegen customizations. #3135

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changes/next-release/feature-AWSSDKforJavav2-6c20b9b.json
Original file line number Diff line number Diff line change
@@ -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."
}
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public class ShapeModifier {
private List<Map<String, ModifyModelShapeModifier>> modify;
private List<Map<String, Member>> inject;
private Integer staxTargetDepthOffset;
private Boolean union;

/**
* @return true if the whole shape should be excluded.
Expand Down Expand Up @@ -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;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,10 @@
"listDirectories",
"listManagedSchemaArns",
"listPublishedSchemaArns"
]
],
"shapeModifiers": {
"TypedAttributeValue": {
"union": true
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"emitPropertyName": "NUL"
}
}
]
],
"union": true
}
},
"verifiedSimpleMethods" : [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"emitPropertyName": "NUL"
}
}
]
],
"union": true
}
},
"sdkModeledExceptionBaseClassName": "DynamoDbException",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,10 @@
"DetachPrincipalPolicy",
"ListPolicyPrincipals",
"ListPrincipalPolicies"
]
],
"shapeModifiers": {
"AssetPropertyVariant": {
"union": true
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,10 @@
],
"blacklistedSimpleMethods": [
"describeLoggingOptions"
]
],
"shapeModifiers": {
"DatastoreStorage": {
"union": true
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"shapeModifiers": {
"DocumentAttributeValue": {
"union": true
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"shapeModifiers": {
"EntitlementValue": {
"union": true
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,15 @@
}
}
]
},
"TransformOperation": {
"union": true
},
"PhysicalTable": {
"union": true
},
"DataSourceParameters": {
"union": true
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,18 @@
"suffix": { "emitEnumValue": "Suffix" }
}
]
},
"ReplicationRuleFilter": {
"union": true
},
"MetricsFilter": {
"union": true
},
"AnalyticsFilter": {
"union": true
},
"LifecycleRuleFilter": {
"union": true
}
},
"serviceConfig": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,10 @@
"listTrainingJobs",
"listTransformJobs",
"listWorkteams"
]
],
"shapeModifiers": {
"TrialComponentParameterValue": {
"union": true
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,10 @@
"blacklistedSimpleMethods": [
"deleteSamplingRule",
"getGroup"
]
],
"shapeModifiers": {
"AnnotationValue": {
"union": true
}
}
}