Skip to content

Commit

Permalink
fix: throw 3XX redirection as errors explicitly (#1591)
Browse files Browse the repository at this point in the history
  • Loading branch information
AllanZhengYP authored Oct 21, 2020
1 parent 9684bf6 commit 76f83f1
Show file tree
Hide file tree
Showing 230 changed files with 7,882 additions and 7,882 deletions.
36 changes: 18 additions & 18 deletions clients/client-accessanalyzer/protocols/Aws_restJson1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,7 @@ export const deserializeAws_restJson1CreateAnalyzerCommand = async (
output: __HttpResponse,
context: __SerdeContext
): Promise<CreateAnalyzerCommandOutput> => {
if (output.statusCode !== 200 && output.statusCode >= 400) {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return deserializeAws_restJson1CreateAnalyzerCommandError(output, context);
}
const contents: CreateAnalyzerCommandOutput = {
Expand Down Expand Up @@ -740,7 +740,7 @@ export const deserializeAws_restJson1CreateArchiveRuleCommand = async (
output: __HttpResponse,
context: __SerdeContext
): Promise<CreateArchiveRuleCommandOutput> => {
if (output.statusCode !== 200 && output.statusCode >= 400) {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return deserializeAws_restJson1CreateArchiveRuleCommandError(output, context);
}
const contents: CreateArchiveRuleCommandOutput = {
Expand Down Expand Up @@ -839,7 +839,7 @@ export const deserializeAws_restJson1DeleteAnalyzerCommand = async (
output: __HttpResponse,
context: __SerdeContext
): Promise<DeleteAnalyzerCommandOutput> => {
if (output.statusCode !== 200 && output.statusCode >= 400) {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return deserializeAws_restJson1DeleteAnalyzerCommandError(output, context);
}
const contents: DeleteAnalyzerCommandOutput = {
Expand Down Expand Up @@ -922,7 +922,7 @@ export const deserializeAws_restJson1DeleteArchiveRuleCommand = async (
output: __HttpResponse,
context: __SerdeContext
): Promise<DeleteArchiveRuleCommandOutput> => {
if (output.statusCode !== 200 && output.statusCode >= 400) {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return deserializeAws_restJson1DeleteArchiveRuleCommandError(output, context);
}
const contents: DeleteArchiveRuleCommandOutput = {
Expand Down Expand Up @@ -1005,7 +1005,7 @@ export const deserializeAws_restJson1GetAnalyzedResourceCommand = async (
output: __HttpResponse,
context: __SerdeContext
): Promise<GetAnalyzedResourceCommandOutput> => {
if (output.statusCode !== 200 && output.statusCode >= 400) {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return deserializeAws_restJson1GetAnalyzedResourceCommandError(output, context);
}
const contents: GetAnalyzedResourceCommandOutput = {
Expand Down Expand Up @@ -1092,7 +1092,7 @@ export const deserializeAws_restJson1GetAnalyzerCommand = async (
output: __HttpResponse,
context: __SerdeContext
): Promise<GetAnalyzerCommandOutput> => {
if (output.statusCode !== 200 && output.statusCode >= 400) {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return deserializeAws_restJson1GetAnalyzerCommandError(output, context);
}
const contents: GetAnalyzerCommandOutput = {
Expand Down Expand Up @@ -1179,7 +1179,7 @@ export const deserializeAws_restJson1GetArchiveRuleCommand = async (
output: __HttpResponse,
context: __SerdeContext
): Promise<GetArchiveRuleCommandOutput> => {
if (output.statusCode !== 200 && output.statusCode >= 400) {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return deserializeAws_restJson1GetArchiveRuleCommandError(output, context);
}
const contents: GetArchiveRuleCommandOutput = {
Expand Down Expand Up @@ -1266,7 +1266,7 @@ export const deserializeAws_restJson1GetFindingCommand = async (
output: __HttpResponse,
context: __SerdeContext
): Promise<GetFindingCommandOutput> => {
if (output.statusCode !== 200 && output.statusCode >= 400) {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return deserializeAws_restJson1GetFindingCommandError(output, context);
}
const contents: GetFindingCommandOutput = {
Expand Down Expand Up @@ -1353,7 +1353,7 @@ export const deserializeAws_restJson1ListAnalyzedResourcesCommand = async (
output: __HttpResponse,
context: __SerdeContext
): Promise<ListAnalyzedResourcesCommandOutput> => {
if (output.statusCode !== 200 && output.statusCode >= 400) {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return deserializeAws_restJson1ListAnalyzedResourcesCommandError(output, context);
}
const contents: ListAnalyzedResourcesCommandOutput = {
Expand Down Expand Up @@ -1444,7 +1444,7 @@ export const deserializeAws_restJson1ListAnalyzersCommand = async (
output: __HttpResponse,
context: __SerdeContext
): Promise<ListAnalyzersCommandOutput> => {
if (output.statusCode !== 200 && output.statusCode >= 400) {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return deserializeAws_restJson1ListAnalyzersCommandError(output, context);
}
const contents: ListAnalyzersCommandOutput = {
Expand Down Expand Up @@ -1527,7 +1527,7 @@ export const deserializeAws_restJson1ListArchiveRulesCommand = async (
output: __HttpResponse,
context: __SerdeContext
): Promise<ListArchiveRulesCommandOutput> => {
if (output.statusCode !== 200 && output.statusCode >= 400) {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return deserializeAws_restJson1ListArchiveRulesCommandError(output, context);
}
const contents: ListArchiveRulesCommandOutput = {
Expand Down Expand Up @@ -1610,7 +1610,7 @@ export const deserializeAws_restJson1ListFindingsCommand = async (
output: __HttpResponse,
context: __SerdeContext
): Promise<ListFindingsCommandOutput> => {
if (output.statusCode !== 200 && output.statusCode >= 400) {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return deserializeAws_restJson1ListFindingsCommandError(output, context);
}
const contents: ListFindingsCommandOutput = {
Expand Down Expand Up @@ -1701,7 +1701,7 @@ export const deserializeAws_restJson1ListTagsForResourceCommand = async (
output: __HttpResponse,
context: __SerdeContext
): Promise<ListTagsForResourceCommandOutput> => {
if (output.statusCode !== 200 && output.statusCode >= 400) {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return deserializeAws_restJson1ListTagsForResourceCommandError(output, context);
}
const contents: ListTagsForResourceCommandOutput = {
Expand Down Expand Up @@ -1788,7 +1788,7 @@ export const deserializeAws_restJson1StartResourceScanCommand = async (
output: __HttpResponse,
context: __SerdeContext
): Promise<StartResourceScanCommandOutput> => {
if (output.statusCode !== 200 && output.statusCode >= 400) {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return deserializeAws_restJson1StartResourceScanCommandError(output, context);
}
const contents: StartResourceScanCommandOutput = {
Expand Down Expand Up @@ -1871,7 +1871,7 @@ export const deserializeAws_restJson1TagResourceCommand = async (
output: __HttpResponse,
context: __SerdeContext
): Promise<TagResourceCommandOutput> => {
if (output.statusCode !== 200 && output.statusCode >= 400) {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return deserializeAws_restJson1TagResourceCommandError(output, context);
}
const contents: TagResourceCommandOutput = {
Expand Down Expand Up @@ -1954,7 +1954,7 @@ export const deserializeAws_restJson1UntagResourceCommand = async (
output: __HttpResponse,
context: __SerdeContext
): Promise<UntagResourceCommandOutput> => {
if (output.statusCode !== 200 && output.statusCode >= 400) {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return deserializeAws_restJson1UntagResourceCommandError(output, context);
}
const contents: UntagResourceCommandOutput = {
Expand Down Expand Up @@ -2037,7 +2037,7 @@ export const deserializeAws_restJson1UpdateArchiveRuleCommand = async (
output: __HttpResponse,
context: __SerdeContext
): Promise<UpdateArchiveRuleCommandOutput> => {
if (output.statusCode !== 200 && output.statusCode >= 400) {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return deserializeAws_restJson1UpdateArchiveRuleCommandError(output, context);
}
const contents: UpdateArchiveRuleCommandOutput = {
Expand Down Expand Up @@ -2120,7 +2120,7 @@ export const deserializeAws_restJson1UpdateFindingsCommand = async (
output: __HttpResponse,
context: __SerdeContext
): Promise<UpdateFindingsCommandOutput> => {
if (output.statusCode !== 200 && output.statusCode >= 400) {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return deserializeAws_restJson1UpdateFindingsCommandError(output, context);
}
const contents: UpdateFindingsCommandOutput = {
Expand Down
40 changes: 20 additions & 20 deletions clients/client-acm-pca/protocols/Aws_json1_1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ export const deserializeAws_json1_1CreateCertificateAuthorityCommand = async (
output: __HttpResponse,
context: __SerdeContext
): Promise<CreateCertificateAuthorityCommandOutput> => {
if (output.statusCode >= 400) {
if (output.statusCode >= 300) {
return deserializeAws_json1_1CreateCertificateAuthorityCommandError(output, context);
}
const data: any = await parseBody(output.body, context);
Expand Down Expand Up @@ -470,7 +470,7 @@ export const deserializeAws_json1_1CreateCertificateAuthorityAuditReportCommand
output: __HttpResponse,
context: __SerdeContext
): Promise<CreateCertificateAuthorityAuditReportCommandOutput> => {
if (output.statusCode >= 400) {
if (output.statusCode >= 300) {
return deserializeAws_json1_1CreateCertificateAuthorityAuditReportCommandError(output, context);
}
const data: any = await parseBody(output.body, context);
Expand Down Expand Up @@ -565,7 +565,7 @@ export const deserializeAws_json1_1CreatePermissionCommand = async (
output: __HttpResponse,
context: __SerdeContext
): Promise<CreatePermissionCommandOutput> => {
if (output.statusCode >= 400) {
if (output.statusCode >= 300) {
return deserializeAws_json1_1CreatePermissionCommandError(output, context);
}
await collectBody(output.body, context);
Expand Down Expand Up @@ -657,7 +657,7 @@ export const deserializeAws_json1_1DeleteCertificateAuthorityCommand = async (
output: __HttpResponse,
context: __SerdeContext
): Promise<DeleteCertificateAuthorityCommandOutput> => {
if (output.statusCode >= 400) {
if (output.statusCode >= 300) {
return deserializeAws_json1_1DeleteCertificateAuthorityCommandError(output, context);
}
await collectBody(output.body, context);
Expand Down Expand Up @@ -733,7 +733,7 @@ export const deserializeAws_json1_1DeletePermissionCommand = async (
output: __HttpResponse,
context: __SerdeContext
): Promise<DeletePermissionCommandOutput> => {
if (output.statusCode >= 400) {
if (output.statusCode >= 300) {
return deserializeAws_json1_1DeletePermissionCommandError(output, context);
}
await collectBody(output.body, context);
Expand Down Expand Up @@ -809,7 +809,7 @@ export const deserializeAws_json1_1DescribeCertificateAuthorityCommand = async (
output: __HttpResponse,
context: __SerdeContext
): Promise<DescribeCertificateAuthorityCommandOutput> => {
if (output.statusCode >= 400) {
if (output.statusCode >= 300) {
return deserializeAws_json1_1DescribeCertificateAuthorityCommandError(output, context);
}
const data: any = await parseBody(output.body, context);
Expand Down Expand Up @@ -872,7 +872,7 @@ export const deserializeAws_json1_1DescribeCertificateAuthorityAuditReportComman
output: __HttpResponse,
context: __SerdeContext
): Promise<DescribeCertificateAuthorityAuditReportCommandOutput> => {
if (output.statusCode >= 400) {
if (output.statusCode >= 300) {
return deserializeAws_json1_1DescribeCertificateAuthorityAuditReportCommandError(output, context);
}
const data: any = await parseBody(output.body, context);
Expand Down Expand Up @@ -943,7 +943,7 @@ export const deserializeAws_json1_1GetCertificateCommand = async (
output: __HttpResponse,
context: __SerdeContext
): Promise<GetCertificateCommandOutput> => {
if (output.statusCode >= 400) {
if (output.statusCode >= 300) {
return deserializeAws_json1_1GetCertificateCommandError(output, context);
}
const data: any = await parseBody(output.body, context);
Expand Down Expand Up @@ -1030,7 +1030,7 @@ export const deserializeAws_json1_1GetCertificateAuthorityCertificateCommand = a
output: __HttpResponse,
context: __SerdeContext
): Promise<GetCertificateAuthorityCertificateCommandOutput> => {
if (output.statusCode >= 400) {
if (output.statusCode >= 300) {
return deserializeAws_json1_1GetCertificateAuthorityCertificateCommandError(output, context);
}
const data: any = await parseBody(output.body, context);
Expand Down Expand Up @@ -1101,7 +1101,7 @@ export const deserializeAws_json1_1GetCertificateAuthorityCsrCommand = async (
output: __HttpResponse,
context: __SerdeContext
): Promise<GetCertificateAuthorityCsrCommandOutput> => {
if (output.statusCode >= 400) {
if (output.statusCode >= 300) {
return deserializeAws_json1_1GetCertificateAuthorityCsrCommandError(output, context);
}
const data: any = await parseBody(output.body, context);
Expand Down Expand Up @@ -1188,7 +1188,7 @@ export const deserializeAws_json1_1ImportCertificateAuthorityCertificateCommand
output: __HttpResponse,
context: __SerdeContext
): Promise<ImportCertificateAuthorityCertificateCommandOutput> => {
if (output.statusCode >= 400) {
if (output.statusCode >= 300) {
return deserializeAws_json1_1ImportCertificateAuthorityCertificateCommandError(output, context);
}
await collectBody(output.body, context);
Expand Down Expand Up @@ -1304,7 +1304,7 @@ export const deserializeAws_json1_1IssueCertificateCommand = async (
output: __HttpResponse,
context: __SerdeContext
): Promise<IssueCertificateCommandOutput> => {
if (output.statusCode >= 400) {
if (output.statusCode >= 300) {
return deserializeAws_json1_1IssueCertificateCommandError(output, context);
}
const data: any = await parseBody(output.body, context);
Expand Down Expand Up @@ -1399,7 +1399,7 @@ export const deserializeAws_json1_1ListCertificateAuthoritiesCommand = async (
output: __HttpResponse,
context: __SerdeContext
): Promise<ListCertificateAuthoritiesCommandOutput> => {
if (output.statusCode >= 400) {
if (output.statusCode >= 300) {
return deserializeAws_json1_1ListCertificateAuthoritiesCommandError(output, context);
}
const data: any = await parseBody(output.body, context);
Expand Down Expand Up @@ -1454,7 +1454,7 @@ export const deserializeAws_json1_1ListPermissionsCommand = async (
output: __HttpResponse,
context: __SerdeContext
): Promise<ListPermissionsCommandOutput> => {
if (output.statusCode >= 400) {
if (output.statusCode >= 300) {
return deserializeAws_json1_1ListPermissionsCommandError(output, context);
}
const data: any = await parseBody(output.body, context);
Expand Down Expand Up @@ -1541,7 +1541,7 @@ export const deserializeAws_json1_1ListTagsCommand = async (
output: __HttpResponse,
context: __SerdeContext
): Promise<ListTagsCommandOutput> => {
if (output.statusCode >= 400) {
if (output.statusCode >= 300) {
return deserializeAws_json1_1ListTagsCommandError(output, context);
}
const data: any = await parseBody(output.body, context);
Expand Down Expand Up @@ -1612,7 +1612,7 @@ export const deserializeAws_json1_1RestoreCertificateAuthorityCommand = async (
output: __HttpResponse,
context: __SerdeContext
): Promise<RestoreCertificateAuthorityCommandOutput> => {
if (output.statusCode >= 400) {
if (output.statusCode >= 300) {
return deserializeAws_json1_1RestoreCertificateAuthorityCommandError(output, context);
}
await collectBody(output.body, context);
Expand Down Expand Up @@ -1680,7 +1680,7 @@ export const deserializeAws_json1_1RevokeCertificateCommand = async (
output: __HttpResponse,
context: __SerdeContext
): Promise<RevokeCertificateCommandOutput> => {
if (output.statusCode >= 400) {
if (output.statusCode >= 300) {
return deserializeAws_json1_1RevokeCertificateCommandError(output, context);
}
await collectBody(output.body, context);
Expand Down Expand Up @@ -1796,7 +1796,7 @@ export const deserializeAws_json1_1TagCertificateAuthorityCommand = async (
output: __HttpResponse,
context: __SerdeContext
): Promise<TagCertificateAuthorityCommandOutput> => {
if (output.statusCode >= 400) {
if (output.statusCode >= 300) {
return deserializeAws_json1_1TagCertificateAuthorityCommandError(output, context);
}
await collectBody(output.body, context);
Expand Down Expand Up @@ -1880,7 +1880,7 @@ export const deserializeAws_json1_1UntagCertificateAuthorityCommand = async (
output: __HttpResponse,
context: __SerdeContext
): Promise<UntagCertificateAuthorityCommandOutput> => {
if (output.statusCode >= 400) {
if (output.statusCode >= 300) {
return deserializeAws_json1_1UntagCertificateAuthorityCommandError(output, context);
}
await collectBody(output.body, context);
Expand Down Expand Up @@ -1956,7 +1956,7 @@ export const deserializeAws_json1_1UpdateCertificateAuthorityCommand = async (
output: __HttpResponse,
context: __SerdeContext
): Promise<UpdateCertificateAuthorityCommandOutput> => {
if (output.statusCode >= 400) {
if (output.statusCode >= 300) {
return deserializeAws_json1_1UpdateCertificateAuthorityCommandError(output, context);
}
await collectBody(output.body, context);
Expand Down
Loading

0 comments on commit 76f83f1

Please sign in to comment.