Skip to content

Commit 5249df4

Browse files
chore(codegen): regenerate with strict body parsing (#2730)
1 parent 92d89f5 commit 5249df4

File tree

135 files changed

+3426
-3132
lines changed

Some content is hidden

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

135 files changed

+3426
-3132
lines changed

clients/client-accessanalyzer/protocols/Aws_restJson1.ts

+20-18
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@a
113113
import {
114114
expectBoolean as __expectBoolean,
115115
expectInt32 as __expectInt32,
116+
expectNonNull as __expectNonNull,
117+
expectObject as __expectObject,
116118
expectString as __expectString,
117119
extendedEncodeURIComponent as __extendedEncodeURIComponent,
118120
strictParseInt32 as __strictParseInt32,
@@ -1179,7 +1181,7 @@ export const deserializeAws_restJson1CreateAccessPreviewCommand = async (
11791181
$metadata: deserializeMetadata(output),
11801182
id: undefined,
11811183
};
1182-
const data: any = await parseBody(output.body, context);
1184+
const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
11831185
if (data.id !== undefined && data.id !== null) {
11841186
contents.id = __expectString(data.id);
11851187
}
@@ -1282,7 +1284,7 @@ export const deserializeAws_restJson1CreateAnalyzerCommand = async (
12821284
$metadata: deserializeMetadata(output),
12831285
arn: undefined,
12841286
};
1285-
const data: any = await parseBody(output.body, context);
1287+
const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
12861288
if (data.arn !== undefined && data.arn !== null) {
12871289
contents.arn = __expectString(data.arn);
12881290
}
@@ -1642,7 +1644,7 @@ export const deserializeAws_restJson1GetAccessPreviewCommand = async (
16421644
$metadata: deserializeMetadata(output),
16431645
accessPreview: undefined,
16441646
};
1645-
const data: any = await parseBody(output.body, context);
1647+
const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
16461648
if (data.accessPreview !== undefined && data.accessPreview !== null) {
16471649
contents.accessPreview = deserializeAws_restJson1AccessPreview(data.accessPreview, context);
16481650
}
@@ -1729,7 +1731,7 @@ export const deserializeAws_restJson1GetAnalyzedResourceCommand = async (
17291731
$metadata: deserializeMetadata(output),
17301732
resource: undefined,
17311733
};
1732-
const data: any = await parseBody(output.body, context);
1734+
const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
17331735
if (data.resource !== undefined && data.resource !== null) {
17341736
contents.resource = deserializeAws_restJson1AnalyzedResource(data.resource, context);
17351737
}
@@ -1816,7 +1818,7 @@ export const deserializeAws_restJson1GetAnalyzerCommand = async (
18161818
$metadata: deserializeMetadata(output),
18171819
analyzer: undefined,
18181820
};
1819-
const data: any = await parseBody(output.body, context);
1821+
const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
18201822
if (data.analyzer !== undefined && data.analyzer !== null) {
18211823
contents.analyzer = deserializeAws_restJson1AnalyzerSummary(data.analyzer, context);
18221824
}
@@ -1903,7 +1905,7 @@ export const deserializeAws_restJson1GetArchiveRuleCommand = async (
19031905
$metadata: deserializeMetadata(output),
19041906
archiveRule: undefined,
19051907
};
1906-
const data: any = await parseBody(output.body, context);
1908+
const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
19071909
if (data.archiveRule !== undefined && data.archiveRule !== null) {
19081910
contents.archiveRule = deserializeAws_restJson1ArchiveRuleSummary(data.archiveRule, context);
19091911
}
@@ -1990,7 +1992,7 @@ export const deserializeAws_restJson1GetFindingCommand = async (
19901992
$metadata: deserializeMetadata(output),
19911993
finding: undefined,
19921994
};
1993-
const data: any = await parseBody(output.body, context);
1995+
const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
19941996
if (data.finding !== undefined && data.finding !== null) {
19951997
contents.finding = deserializeAws_restJson1Finding(data.finding, context);
19961998
}
@@ -2078,7 +2080,7 @@ export const deserializeAws_restJson1GetGeneratedPolicyCommand = async (
20782080
generatedPolicyResult: undefined,
20792081
jobDetails: undefined,
20802082
};
2081-
const data: any = await parseBody(output.body, context);
2083+
const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
20822084
if (data.generatedPolicyResult !== undefined && data.generatedPolicyResult !== null) {
20832085
contents.generatedPolicyResult = deserializeAws_restJson1GeneratedPolicyResult(data.generatedPolicyResult, context);
20842086
}
@@ -2161,7 +2163,7 @@ export const deserializeAws_restJson1ListAccessPreviewFindingsCommand = async (
21612163
findings: undefined,
21622164
nextToken: undefined,
21632165
};
2164-
const data: any = await parseBody(output.body, context);
2166+
const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
21652167
if (data.findings !== undefined && data.findings !== null) {
21662168
contents.findings = deserializeAws_restJson1AccessPreviewFindingsList(data.findings, context);
21672169
}
@@ -2260,7 +2262,7 @@ export const deserializeAws_restJson1ListAccessPreviewsCommand = async (
22602262
accessPreviews: undefined,
22612263
nextToken: undefined,
22622264
};
2263-
const data: any = await parseBody(output.body, context);
2265+
const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
22642266
if (data.accessPreviews !== undefined && data.accessPreviews !== null) {
22652267
contents.accessPreviews = deserializeAws_restJson1AccessPreviewsList(data.accessPreviews, context);
22662268
}
@@ -2351,7 +2353,7 @@ export const deserializeAws_restJson1ListAnalyzedResourcesCommand = async (
23512353
analyzedResources: undefined,
23522354
nextToken: undefined,
23532355
};
2354-
const data: any = await parseBody(output.body, context);
2356+
const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
23552357
if (data.analyzedResources !== undefined && data.analyzedResources !== null) {
23562358
contents.analyzedResources = deserializeAws_restJson1AnalyzedResourcesList(data.analyzedResources, context);
23572359
}
@@ -2442,7 +2444,7 @@ export const deserializeAws_restJson1ListAnalyzersCommand = async (
24422444
analyzers: undefined,
24432445
nextToken: undefined,
24442446
};
2445-
const data: any = await parseBody(output.body, context);
2447+
const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
24462448
if (data.analyzers !== undefined && data.analyzers !== null) {
24472449
contents.analyzers = deserializeAws_restJson1AnalyzersList(data.analyzers, context);
24482450
}
@@ -2525,7 +2527,7 @@ export const deserializeAws_restJson1ListArchiveRulesCommand = async (
25252527
archiveRules: undefined,
25262528
nextToken: undefined,
25272529
};
2528-
const data: any = await parseBody(output.body, context);
2530+
const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
25292531
if (data.archiveRules !== undefined && data.archiveRules !== null) {
25302532
contents.archiveRules = deserializeAws_restJson1ArchiveRulesList(data.archiveRules, context);
25312533
}
@@ -2608,7 +2610,7 @@ export const deserializeAws_restJson1ListFindingsCommand = async (
26082610
findings: undefined,
26092611
nextToken: undefined,
26102612
};
2611-
const data: any = await parseBody(output.body, context);
2613+
const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
26122614
if (data.findings !== undefined && data.findings !== null) {
26132615
contents.findings = deserializeAws_restJson1FindingsList(data.findings, context);
26142616
}
@@ -2699,7 +2701,7 @@ export const deserializeAws_restJson1ListPolicyGenerationsCommand = async (
26992701
nextToken: undefined,
27002702
policyGenerations: undefined,
27012703
};
2702-
const data: any = await parseBody(output.body, context);
2704+
const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
27032705
if (data.nextToken !== undefined && data.nextToken !== null) {
27042706
contents.nextToken = __expectString(data.nextToken);
27052707
}
@@ -2781,7 +2783,7 @@ export const deserializeAws_restJson1ListTagsForResourceCommand = async (
27812783
$metadata: deserializeMetadata(output),
27822784
tags: undefined,
27832785
};
2784-
const data: any = await parseBody(output.body, context);
2786+
const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
27852787
if (data.tags !== undefined && data.tags !== null) {
27862788
contents.tags = deserializeAws_restJson1TagsMap(data.tags, context);
27872789
}
@@ -2868,7 +2870,7 @@ export const deserializeAws_restJson1StartPolicyGenerationCommand = async (
28682870
$metadata: deserializeMetadata(output),
28692871
jobId: undefined,
28702872
};
2871-
const data: any = await parseBody(output.body, context);
2873+
const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
28722874
if (data.jobId !== undefined && data.jobId !== null) {
28732875
contents.jobId = __expectString(data.jobId);
28742876
}
@@ -3379,7 +3381,7 @@ export const deserializeAws_restJson1ValidatePolicyCommand = async (
33793381
findings: undefined,
33803382
nextToken: undefined,
33813383
};
3382-
const data: any = await parseBody(output.body, context);
3384+
const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
33833385
if (data.findings !== undefined && data.findings !== null) {
33843386
contents.findings = deserializeAws_restJson1ValidatePolicyFindingList(data.findings, context);
33853387
}

clients/client-amp/protocols/Aws_restJson1.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ import {
2121
} from "../models/models_0";
2222
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
2323
import {
24+
expectNonNull as __expectNonNull,
25+
expectObject as __expectObject,
2426
expectString as __expectString,
2527
extendedEncodeURIComponent as __extendedEncodeURIComponent,
2628
strictParseInt32 as __strictParseInt32,
@@ -194,7 +196,7 @@ export const deserializeAws_restJson1CreateWorkspaceCommand = async (
194196
status: undefined,
195197
workspaceId: undefined,
196198
};
197-
const data: any = await parseBody(output.body, context);
199+
const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
198200
if (data.arn !== undefined && data.arn !== null) {
199201
contents.arn = __expectString(data.arn);
200202
}
@@ -378,7 +380,7 @@ export const deserializeAws_restJson1DescribeWorkspaceCommand = async (
378380
$metadata: deserializeMetadata(output),
379381
workspace: undefined,
380382
};
381-
const data: any = await parseBody(output.body, context);
383+
const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
382384
if (data.workspace !== undefined && data.workspace !== null) {
383385
contents.workspace = deserializeAws_restJson1WorkspaceDescription(data.workspace, context);
384386
}
@@ -466,7 +468,7 @@ export const deserializeAws_restJson1ListWorkspacesCommand = async (
466468
nextToken: undefined,
467469
workspaces: undefined,
468470
};
469-
const data: any = await parseBody(output.body, context);
471+
const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
470472
if (data.nextToken !== undefined && data.nextToken !== null) {
471473
contents.nextToken = __expectString(data.nextToken);
472474
}

0 commit comments

Comments
 (0)