Skip to content

Commit 23d5fe8

Browse files
authored
fix(clients): unknown union member serialization in json (#6892)
1 parent b2252ef commit 23d5fe8

File tree

43 files changed

+91
-91
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+91
-91
lines changed

clients/client-amp/src/protocols/Aws_restJson1.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1455,7 +1455,7 @@ const de_ValidationExceptionRes = async (parsedOutput: any, context: __SerdeCont
14551455
const se_ScrapeConfiguration = (input: ScrapeConfiguration, context: __SerdeContext): any => {
14561456
return ScrapeConfiguration.visit(input, {
14571457
configurationBlob: (value) => ({ configurationBlob: context.base64Encoder(value) }),
1458-
_: (name, value) => ({ name: value } as any),
1458+
_: (name, value) => ({ [name]: value } as any),
14591459
});
14601460
};
14611461

clients/client-application-discovery-service/src/protocols/Aws_json1_1.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1384,7 +1384,7 @@ const se_ExportPreferences = (input: ExportPreferences, context: __SerdeContext)
13841384
ec2RecommendationsPreferences: (value) => ({
13851385
ec2RecommendationsPreferences: se_Ec2RecommendationsExportPreferences(value, context),
13861386
}),
1387-
_: (name, value) => ({ name: value } as any),
1387+
_: (name, value) => ({ [name]: value } as any),
13881388
});
13891389
};
13901390

clients/client-application-signals/src/protocols/Aws_restJson1.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -962,7 +962,7 @@ const se_Interval = (input: Interval, context: __SerdeContext): any => {
962962
return Interval.visit(input, {
963963
CalendarInterval: (value) => ({ CalendarInterval: se_CalendarInterval(value, context) }),
964964
RollingInterval: (value) => ({ RollingInterval: _json(value) }),
965-
_: (name, value) => ({ name: value } as any),
965+
_: (name, value) => ({ [name]: value } as any),
966966
});
967967
};
968968

clients/client-bcm-pricing-calculator/src/protocols/Aws_json1_0.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1867,7 +1867,7 @@ const se_BillScenarioCommitmentModificationAction = (
18671867
addSavingsPlanAction: (value) => ({ addSavingsPlanAction: se_AddSavingsPlanAction(value, context) }),
18681868
negateReservedInstanceAction: (value) => ({ negateReservedInstanceAction: _json(value) }),
18691869
negateSavingsPlanAction: (value) => ({ negateSavingsPlanAction: _json(value) }),
1870-
_: (name, value) => ({ name: value } as any),
1870+
_: (name, value) => ({ [name]: value } as any),
18711871
});
18721872
};
18731873

clients/client-bedrock-agent-runtime/src/protocols/Aws_restJson1.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1722,7 +1722,7 @@ const se_FlowInput = (input: FlowInput, context: __SerdeContext): any => {
17221722
const se_FlowInputContent = (input: FlowInputContent, context: __SerdeContext): any => {
17231723
return FlowInputContent.visit(input, {
17241724
document: (value) => ({ document: se_Document(value, context) }),
1725-
_: (name, value) => ({ name: value } as any),
1725+
_: (name, value) => ({ [name]: value } as any),
17261726
});
17271727
};
17281728

@@ -2063,7 +2063,7 @@ const se_RetrievalFilter = (input: RetrievalFilter, context: __SerdeContext): an
20632063
orAll: (value) => ({ orAll: se_RetrievalFilterList(value, context) }),
20642064
startsWith: (value) => ({ startsWith: se_FilterAttribute(value, context) }),
20652065
stringContains: (value) => ({ stringContains: se_FilterAttribute(value, context) }),
2066-
_: (name, value) => ({ name: value } as any),
2066+
_: (name, value) => ({ [name]: value } as any),
20672067
});
20682068
};
20692069

clients/client-bedrock-agent/src/protocols/Aws_restJson1.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3972,7 +3972,7 @@ const se_FlowNodeConfiguration = (input: FlowNodeConfiguration, context: __Serde
39723972
prompt: (value) => ({ prompt: se_PromptFlowNodeConfiguration(value, context) }),
39733973
retrieval: (value) => ({ retrieval: _json(value) }),
39743974
storage: (value) => ({ storage: _json(value) }),
3975-
_: (name, value) => ({ name: value } as any),
3975+
_: (name, value) => ({ [name]: value } as any),
39763976
});
39773977
};
39783978

@@ -4215,7 +4215,7 @@ const se_PromptFlowNodeSourceConfiguration = (
42154215
return PromptFlowNodeSourceConfiguration.visit(input, {
42164216
inline: (value) => ({ inline: se_PromptFlowNodeInlineConfiguration(value, context) }),
42174217
resource: (value) => ({ resource: _json(value) }),
4218-
_: (name, value) => ({ name: value } as any),
4218+
_: (name, value) => ({ [name]: value } as any),
42194219
});
42204220
};
42214221

@@ -4227,7 +4227,7 @@ const se_PromptFlowNodeSourceConfiguration = (
42274227
const se_PromptInferenceConfiguration = (input: PromptInferenceConfiguration, context: __SerdeContext): any => {
42284228
return PromptInferenceConfiguration.visit(input, {
42294229
text: (value) => ({ text: se_PromptModelInferenceConfiguration(value, context) }),
4230-
_: (name, value) => ({ name: value } as any),
4230+
_: (name, value) => ({ [name]: value } as any),
42314231
});
42324232
};
42334233

@@ -4271,7 +4271,7 @@ const se_PromptTemplateConfiguration = (input: PromptTemplateConfiguration, cont
42714271
return PromptTemplateConfiguration.visit(input, {
42724272
chat: (value) => ({ chat: se_ChatPromptTemplateConfiguration(value, context) }),
42734273
text: (value) => ({ text: _json(value) }),
4274-
_: (name, value) => ({ name: value } as any),
4274+
_: (name, value) => ({ [name]: value } as any),
42754275
});
42764276
};
42774277

@@ -4421,7 +4421,7 @@ const se_Tool = (input: Tool, context: __SerdeContext): any => {
44214421
return Tool.visit(input, {
44224422
cachePoint: (value) => ({ cachePoint: _json(value) }),
44234423
toolSpec: (value) => ({ toolSpec: se_ToolSpecification(value, context) }),
4424-
_: (name, value) => ({ name: value } as any),
4424+
_: (name, value) => ({ [name]: value } as any),
44254425
});
44264426
};
44274427

@@ -4443,7 +4443,7 @@ const se_ToolConfiguration = (input: ToolConfiguration, context: __SerdeContext)
44434443
const se_ToolInputSchema = (input: ToolInputSchema, context: __SerdeContext): any => {
44444444
return ToolInputSchema.visit(input, {
44454445
json: (value) => ({ json: se_Document(value, context) }),
4446-
_: (name, value) => ({ name: value } as any),
4446+
_: (name, value) => ({ [name]: value } as any),
44474447
});
44484448
};
44494449

clients/client-bedrock-runtime/src/protocols/Aws_restJson1.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1044,7 +1044,7 @@ const se_ContentBlock = (input: ContentBlock, context: __SerdeContext): any => {
10441044
toolResult: (value) => ({ toolResult: se_ToolResultBlock(value, context) }),
10451045
toolUse: (value) => ({ toolUse: se_ToolUseBlock(value, context) }),
10461046
video: (value) => ({ video: se_VideoBlock(value, context) }),
1047-
_: (name, value) => ({ name: value } as any),
1047+
_: (name, value) => ({ [name]: value } as any),
10481048
});
10491049
};
10501050

@@ -1076,7 +1076,7 @@ const se_DocumentBlock = (input: DocumentBlock, context: __SerdeContext): any =>
10761076
const se_DocumentSource = (input: DocumentSource, context: __SerdeContext): any => {
10771077
return DocumentSource.visit(input, {
10781078
bytes: (value) => ({ bytes: context.base64Encoder(value) }),
1079-
_: (name, value) => ({ name: value } as any),
1079+
_: (name, value) => ({ [name]: value } as any),
10801080
});
10811081
};
10821082

@@ -1089,7 +1089,7 @@ const se_GuardrailContentBlock = (input: GuardrailContentBlock, context: __Serde
10891089
return GuardrailContentBlock.visit(input, {
10901090
image: (value) => ({ image: se_GuardrailImageBlock(value, context) }),
10911091
text: (value) => ({ text: _json(value) }),
1092-
_: (name, value) => ({ name: value } as any),
1092+
_: (name, value) => ({ [name]: value } as any),
10931093
});
10941094
};
10951095

@@ -1113,7 +1113,7 @@ const se_GuardrailConverseContentBlock = (input: GuardrailConverseContentBlock,
11131113
return GuardrailConverseContentBlock.visit(input, {
11141114
image: (value) => ({ image: se_GuardrailConverseImageBlock(value, context) }),
11151115
text: (value) => ({ text: _json(value) }),
1116-
_: (name, value) => ({ name: value } as any),
1116+
_: (name, value) => ({ [name]: value } as any),
11171117
});
11181118
};
11191119

@@ -1135,7 +1135,7 @@ const se_GuardrailConverseImageBlock = (input: GuardrailConverseImageBlock, cont
11351135
const se_GuardrailConverseImageSource = (input: GuardrailConverseImageSource, context: __SerdeContext): any => {
11361136
return GuardrailConverseImageSource.visit(input, {
11371137
bytes: (value) => ({ bytes: context.base64Encoder(value) }),
1138-
_: (name, value) => ({ name: value } as any),
1138+
_: (name, value) => ({ [name]: value } as any),
11391139
});
11401140
};
11411141

@@ -1157,7 +1157,7 @@ const se_GuardrailImageBlock = (input: GuardrailImageBlock, context: __SerdeCont
11571157
const se_GuardrailImageSource = (input: GuardrailImageSource, context: __SerdeContext): any => {
11581158
return GuardrailImageSource.visit(input, {
11591159
bytes: (value) => ({ bytes: context.base64Encoder(value) }),
1160-
_: (name, value) => ({ name: value } as any),
1160+
_: (name, value) => ({ [name]: value } as any),
11611161
});
11621162
};
11631163

@@ -1181,7 +1181,7 @@ const se_ImageBlock = (input: ImageBlock, context: __SerdeContext): any => {
11811181
const se_ImageSource = (input: ImageSource, context: __SerdeContext): any => {
11821182
return ImageSource.visit(input, {
11831183
bytes: (value) => ({ bytes: context.base64Encoder(value) }),
1184-
_: (name, value) => ({ name: value } as any),
1184+
_: (name, value) => ({ [name]: value } as any),
11851185
});
11861186
};
11871187

@@ -1246,7 +1246,7 @@ const se_SystemContentBlock = (input: SystemContentBlock, context: __SerdeContex
12461246
return SystemContentBlock.visit(input, {
12471247
guardContent: (value) => ({ guardContent: se_GuardrailConverseContentBlock(value, context) }),
12481248
text: (value) => ({ text: value }),
1249-
_: (name, value) => ({ name: value } as any),
1249+
_: (name, value) => ({ [name]: value } as any),
12501250
});
12511251
};
12521252

@@ -1271,7 +1271,7 @@ const se_SystemContentBlocks = (input: SystemContentBlock[], context: __SerdeCon
12711271
const se_Tool = (input: Tool, context: __SerdeContext): any => {
12721272
return Tool.visit(input, {
12731273
toolSpec: (value) => ({ toolSpec: se_ToolSpecification(value, context) }),
1274-
_: (name, value) => ({ name: value } as any),
1274+
_: (name, value) => ({ [name]: value } as any),
12751275
});
12761276
};
12771277

@@ -1293,7 +1293,7 @@ const se_ToolConfiguration = (input: ToolConfiguration, context: __SerdeContext)
12931293
const se_ToolInputSchema = (input: ToolInputSchema, context: __SerdeContext): any => {
12941294
return ToolInputSchema.visit(input, {
12951295
json: (value) => ({ json: se_Document(value, context) }),
1296-
_: (name, value) => ({ name: value } as any),
1296+
_: (name, value) => ({ [name]: value } as any),
12971297
});
12981298
};
12991299

@@ -1318,7 +1318,7 @@ const se_ToolResultContentBlock = (input: ToolResultContentBlock, context: __Ser
13181318
json: (value) => ({ json: se_Document(value, context) }),
13191319
text: (value) => ({ text: value }),
13201320
video: (value) => ({ video: se_VideoBlock(value, context) }),
1321-
_: (name, value) => ({ name: value } as any),
1321+
_: (name, value) => ({ [name]: value } as any),
13221322
});
13231323
};
13241324

@@ -1383,7 +1383,7 @@ const se_VideoSource = (input: VideoSource, context: __SerdeContext): any => {
13831383
return VideoSource.visit(input, {
13841384
bytes: (value) => ({ bytes: context.base64Encoder(value) }),
13851385
s3Location: (value) => ({ s3Location: _json(value) }),
1386-
_: (name, value) => ({ name: value } as any),
1386+
_: (name, value) => ({ [name]: value } as any),
13871387
});
13881388
};
13891389

clients/client-bedrock/src/protocols/Aws_restJson1.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3096,7 +3096,7 @@ const se_EvaluationInferenceConfig = (input: EvaluationInferenceConfig, context:
30963096
return EvaluationInferenceConfig.visit(input, {
30973097
models: (value) => ({ models: _json(value) }),
30983098
ragConfigs: (value) => ({ ragConfigs: se_RagConfigs(value, context) }),
3099-
_: (name, value) => ({ name: value } as any),
3099+
_: (name, value) => ({ [name]: value } as any),
31003100
});
31013101
};
31023102

@@ -3301,7 +3301,7 @@ const se_KnowledgeBaseConfig = (input: KnowledgeBaseConfig, context: __SerdeCont
33013301
retrieveAndGenerateConfig: se_RetrieveAndGenerateConfiguration(value, context),
33023302
}),
33033303
retrieveConfig: (value) => ({ retrieveConfig: se_RetrieveConfig(value, context) }),
3304-
_: (name, value) => ({ name: value } as any),
3304+
_: (name, value) => ({ [name]: value } as any),
33053305
});
33063306
};
33073307

@@ -3377,7 +3377,7 @@ const se_KnowledgeBaseVectorSearchConfiguration = (
33773377
const se_RAGConfig = (input: RAGConfig, context: __SerdeContext): any => {
33783378
return RAGConfig.visit(input, {
33793379
knowledgeBaseConfig: (value) => ({ knowledgeBaseConfig: se_KnowledgeBaseConfig(value, context) }),
3380-
_: (name, value) => ({ name: value } as any),
3380+
_: (name, value) => ({ [name]: value } as any),
33813381
});
33823382
};
33833383

@@ -3420,7 +3420,7 @@ const se_RetrievalFilter = (input: RetrievalFilter, context: __SerdeContext): an
34203420
orAll: (value) => ({ orAll: se_RetrievalFilterList(value, context) }),
34213421
startsWith: (value) => ({ startsWith: se_FilterAttribute(value, context) }),
34223422
stringContains: (value) => ({ stringContains: se_FilterAttribute(value, context) }),
3423-
_: (name, value) => ({ name: value } as any),
3423+
_: (name, value) => ({ [name]: value } as any),
34243424
});
34253425
};
34263426

clients/client-clouddirectory/src/protocols/Aws_restJson1.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4447,7 +4447,7 @@ const se_TypedAttributeValue = (input: TypedAttributeValue, context: __SerdeCont
44474447
DatetimeValue: (value) => ({ DatetimeValue: value.getTime() / 1_000 }),
44484448
NumberValue: (value) => ({ NumberValue: value }),
44494449
StringValue: (value) => ({ StringValue: value }),
4450-
_: (name, value) => ({ name: value } as any),
4450+
_: (name, value) => ({ [name]: value } as any),
44514451
});
44524452
};
44534453

clients/client-connect/src/protocols/Aws_restJson1.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14190,7 +14190,7 @@ const se_EvaluationAnswerData = (input: EvaluationAnswerData, context: __SerdeCo
1419014190
NotApplicable: (value) => ({ NotApplicable: value }),
1419114191
NumericValue: (value) => ({ NumericValue: __serializeFloat(value) }),
1419214192
StringValue: (value) => ({ StringValue: value }),
14193-
_: (name, value) => ({ name: value } as any),
14193+
_: (name, value) => ({ [name]: value } as any),
1419414194
});
1419514195
};
1419614196

@@ -14223,7 +14223,7 @@ const se_EvaluationFormItem = (input: EvaluationFormItem, context: __SerdeContex
1422314223
return EvaluationFormItem.visit(input, {
1422414224
Question: (value) => ({ Question: se_EvaluationFormQuestion(value, context) }),
1422514225
Section: (value) => ({ Section: se_EvaluationFormSection(value, context) }),
14226-
_: (name, value) => ({ name: value } as any),
14226+
_: (name, value) => ({ [name]: value } as any),
1422714227
});
1422814228
};
1422914229

0 commit comments

Comments
 (0)