-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
codegen: Update API client generation to not support new JSONValue me…
…mbers (#4269) Updates the SDK's code generation to stop supporting new API modeled JSONValue parameters. The SDK's JSONValue type is only compatible with JSON documents with a top level JSON Object. JSON Lists, Strings, Scalars, are not compatible. This prevents JSON Value working with some APIs such as Amazon Lex Runtime Service's operations. This update also introduces the breaking change to service/lexruntimeservice package by changing the following parameters from a JSONValue to string type. * PostContentInput.ActiveContexts * PutContentOutput.AlternativeIntents * PutContentOutput.ActiveContexts * PutSessionOutput.ActiveContexts
- Loading branch information
Showing
12 changed files
with
476 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,13 @@ | ||
### SDK Features | ||
* `codegen`: Updates the SDK's code generation to stop supporting new API modeled JSONValue parameters. The SDK's JSONValue type is only compatible with JSON documents with a top level JSON Object. JSON Lists, Strings, Scalars, are not compatible. This prevents JSON Value working with some APIs such as Amazon Lex Runtime Service's operations. | ||
* Related to [#4264](https://github.com/aws/aws-sdk-go/pull/4264) and [#4258](https://github.com/aws/aws-sdk-go/issues/4258) | ||
|
||
### SDK Enhancements | ||
|
||
### SDK Bugs | ||
* `service/lexruntimeservice`: Introduces a breaking change for following parameters from a JSONValue to string type, because the SDKs JSONValue is not compatible with JSON documents of lists. | ||
* PostContentInput.ActiveContexts | ||
* PutContentOutput.AlternativeIntents | ||
* PutContentOutput.ActiveContexts | ||
* PutSessionOutput.ActiveContexts | ||
* Fixes [#4258](https://github.com/aws/aws-sdk-go/issues/4258) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,257 @@ | ||
//go:build codegen | ||
// +build codegen | ||
|
||
package api | ||
|
||
type legacyJSONValues struct { | ||
Type string | ||
StructMembers map[string]struct{} | ||
ListMemberRef bool | ||
MapValueRef bool | ||
} | ||
|
||
var legacyJSONValueShapes = map[string]map[string]legacyJSONValues{ | ||
"braket": map[string]legacyJSONValues{ | ||
"CreateQuantumTaskRequest": legacyJSONValues{ | ||
Type: "structure", | ||
StructMembers: map[string]struct{}{ | ||
"action": struct{}{}, | ||
"deviceParameters": struct{}{}, | ||
}, | ||
}, | ||
"GetDeviceResponse": legacyJSONValues{ | ||
Type: "structure", | ||
StructMembers: map[string]struct{}{ | ||
"deviceCapabilities": struct{}{}, | ||
}, | ||
}, | ||
"GetQuantumTaskResponse": legacyJSONValues{ | ||
Type: "structure", | ||
StructMembers: map[string]struct{}{ | ||
"deviceParameters": struct{}{}, | ||
}, | ||
}, | ||
}, | ||
"cloudwatchevidently": map[string]legacyJSONValues{ | ||
"EvaluateFeatureRequest": legacyJSONValues{ | ||
Type: "structure", | ||
StructMembers: map[string]struct{}{ | ||
"evaluationContext": struct{}{}, | ||
}, | ||
}, | ||
"EvaluateFeatureResponse": legacyJSONValues{ | ||
Type: "structure", | ||
StructMembers: map[string]struct{}{ | ||
"details": struct{}{}, | ||
}, | ||
}, | ||
"EvaluationRequest": legacyJSONValues{ | ||
Type: "structure", | ||
StructMembers: map[string]struct{}{ | ||
"evaluationContext": struct{}{}, | ||
}, | ||
}, | ||
"EvaluationResult": legacyJSONValues{ | ||
Type: "structure", | ||
StructMembers: map[string]struct{}{ | ||
"details": struct{}{}, | ||
}, | ||
}, | ||
"Event": legacyJSONValues{ | ||
Type: "structure", | ||
StructMembers: map[string]struct{}{ | ||
"data": struct{}{}, | ||
}, | ||
}, | ||
"ExperimentReport": legacyJSONValues{ | ||
Type: "structure", | ||
StructMembers: map[string]struct{}{ | ||
"content": struct{}{}, | ||
}, | ||
}, | ||
"MetricDefinition": legacyJSONValues{ | ||
Type: "structure", | ||
StructMembers: map[string]struct{}{ | ||
"eventPattern": struct{}{}, | ||
}, | ||
}, | ||
"MetricDefinitionConfig": legacyJSONValues{ | ||
Type: "structure", | ||
StructMembers: map[string]struct{}{ | ||
"eventPattern": struct{}{}, | ||
}, | ||
}, | ||
}, | ||
"cloudwatchrum": map[string]legacyJSONValues{ | ||
"RumEvent": legacyJSONValues{ | ||
Type: "structure", | ||
StructMembers: map[string]struct{}{ | ||
"details": struct{}{}, | ||
"metadata": struct{}{}, | ||
}, | ||
}, | ||
}, | ||
"lexruntimeservice": map[string]legacyJSONValues{ | ||
"PostContentRequest": legacyJSONValues{ | ||
Type: "structure", | ||
StructMembers: map[string]struct{}{ | ||
"requestAttributes": struct{}{}, | ||
//"ActiveContexts": struct{}{}, - Disabled because JSON List | ||
"sessionAttributes": struct{}{}, | ||
}, | ||
}, | ||
"PostContentResponse": legacyJSONValues{ | ||
Type: "structure", | ||
StructMembers: map[string]struct{}{ | ||
// "alternativeIntents": struct{}{}, - Disabled because JSON List | ||
"sessionAttributes": struct{}{}, | ||
"nluIntentConfidence": struct{}{}, | ||
"slots": struct{}{}, | ||
//"activeContexts": struct{}{}, - Disabled because JSON List | ||
}, | ||
}, | ||
"PutSessionResponse": legacyJSONValues{ | ||
Type: "structure", | ||
StructMembers: map[string]struct{}{ | ||
// "activeContexts": struct{}{}, - Disabled because JSON List | ||
"slots": struct{}{}, | ||
"sessionAttributes": struct{}{}, | ||
}, | ||
}, | ||
}, | ||
"lookoutequipment": map[string]legacyJSONValues{ | ||
"DatasetSchema": legacyJSONValues{ | ||
Type: "structure", | ||
StructMembers: map[string]struct{}{ | ||
"InlineDataSchema": struct{}{}, | ||
}, | ||
}, | ||
"DescribeDatasetResponse": legacyJSONValues{ | ||
Type: "structure", | ||
StructMembers: map[string]struct{}{ | ||
"Schema": struct{}{}, | ||
}, | ||
}, | ||
"DescribeModelResponse": legacyJSONValues{ | ||
Type: "structure", | ||
StructMembers: map[string]struct{}{ | ||
"Schema": struct{}{}, | ||
"ModelMetrics": struct{}{}, | ||
}, | ||
}, | ||
}, | ||
"networkmanager": map[string]legacyJSONValues{ | ||
"CoreNetworkPolicy": legacyJSONValues{ | ||
Type: "structure", | ||
StructMembers: map[string]struct{}{ | ||
"PolicyDocument": struct{}{}, | ||
}, | ||
}, | ||
"GetResourcePolicyResponse": legacyJSONValues{ | ||
Type: "structure", | ||
StructMembers: map[string]struct{}{ | ||
"PolicyDocument": struct{}{}, | ||
}, | ||
}, | ||
"PutCoreNetworkPolicyRequest": legacyJSONValues{ | ||
Type: "structure", | ||
StructMembers: map[string]struct{}{ | ||
"PolicyDocument": struct{}{}, | ||
}, | ||
}, | ||
"PutResourcePolicyRequest": legacyJSONValues{ | ||
Type: "structure", | ||
StructMembers: map[string]struct{}{ | ||
"PolicyDocument": struct{}{}, | ||
}, | ||
}, | ||
}, | ||
"personalizeevents": map[string]legacyJSONValues{ | ||
"Event": legacyJSONValues{ | ||
Type: "structure", | ||
StructMembers: map[string]struct{}{ | ||
"properties": struct{}{}, | ||
}, | ||
}, | ||
"Item": legacyJSONValues{ | ||
Type: "structure", | ||
StructMembers: map[string]struct{}{ | ||
"properties": struct{}{}, | ||
}, | ||
}, | ||
"User": legacyJSONValues{ | ||
Type: "structure", | ||
StructMembers: map[string]struct{}{ | ||
"properties": struct{}{}, | ||
}, | ||
}, | ||
}, | ||
"pricing": map[string]legacyJSONValues{ | ||
"PriceList": legacyJSONValues{ | ||
Type: "list", | ||
ListMemberRef: true, | ||
}, | ||
}, | ||
"rekognition": map[string]legacyJSONValues{ | ||
"HumanLoopActivationOutput": legacyJSONValues{ | ||
Type: "structure", | ||
StructMembers: map[string]struct{}{ | ||
"HumanLoopActivationConditionsEvaluationResults": struct{}{}, | ||
}, | ||
}, | ||
}, | ||
"sagemaker": map[string]legacyJSONValues{ | ||
"HumanLoopActivationConditionsConfig": legacyJSONValues{ | ||
Type: "structure", | ||
StructMembers: map[string]struct{}{ | ||
"HumanLoopActivationConditions": struct{}{}, | ||
}, | ||
}, | ||
}, | ||
"schemas": map[string]legacyJSONValues{ | ||
"GetResourcePolicyResponse": legacyJSONValues{ | ||
Type: "structure", | ||
StructMembers: map[string]struct{}{ | ||
"Policy": struct{}{}, | ||
}, | ||
}, | ||
"PutResourcePolicyRequest": legacyJSONValues{ | ||
Type: "structure", | ||
StructMembers: map[string]struct{}{ | ||
"Policy": struct{}{}, | ||
}, | ||
}, | ||
"PutResourcePolicyResponse": legacyJSONValues{ | ||
Type: "structure", | ||
StructMembers: map[string]struct{}{ | ||
"Policy": struct{}{}, | ||
}, | ||
}, | ||
"GetResourcePolicyOutput": legacyJSONValues{ | ||
Type: "structure", | ||
StructMembers: map[string]struct{}{ | ||
"Policy": struct{}{}, | ||
}, | ||
}, | ||
"PutResourcePolicyInput": legacyJSONValues{ | ||
Type: "structure", | ||
StructMembers: map[string]struct{}{ | ||
"Policy": struct{}{}, | ||
}, | ||
}, | ||
"PutResourcePolicyOutput": legacyJSONValues{ | ||
Type: "structure", | ||
StructMembers: map[string]struct{}{ | ||
"Policy": struct{}{}, | ||
}, | ||
}, | ||
}, | ||
"textract": map[string]legacyJSONValues{ | ||
"HumanLoopActivationOutput": legacyJSONValues{ | ||
Type: "structure", | ||
StructMembers: map[string]struct{}{ | ||
"HumanLoopActivationConditionsEvaluationResults": struct{}{}, | ||
}, | ||
}, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.