Skip to content

Commit

Permalink
fix(codegen): revert check for required query parameters
Browse files Browse the repository at this point in the history
This reverts commit 0441081.
  • Loading branch information
trivikr committed Nov 23, 2022
1 parent 0441081 commit 3a5313a
Show file tree
Hide file tree
Showing 134 changed files with 511 additions and 901 deletions.
15 changes: 6 additions & 9 deletions clients/client-accessanalyzer/src/protocols/Aws_restJson1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ export const serializeAws_restJson1GetAccessPreviewCommand = async (
false
);
const query: any = map({
analyzerArn: [, __expectNonNull(input.analyzerArn!, `analyzerArn`)],
analyzerArn: [, input.analyzerArn!],
});
let body: any;
return new __HttpRequest({
Expand All @@ -388,8 +388,8 @@ export const serializeAws_restJson1GetAnalyzedResourceCommand = async (
const headers: any = {};
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/analyzed-resource";
const query: any = map({
analyzerArn: [, __expectNonNull(input.analyzerArn!, `analyzerArn`)],
resourceArn: [, __expectNonNull(input.resourceArn!, `resourceArn`)],
analyzerArn: [, input.analyzerArn!],
resourceArn: [, input.resourceArn!],
});
let body: any;
return new __HttpRequest({
Expand Down Expand Up @@ -470,7 +470,7 @@ export const serializeAws_restJson1GetFindingCommand = async (
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/finding/{id}";
resolvedPath = __resolvedPath(resolvedPath, input, "id", () => input.id!, "{id}", false);
const query: any = map({
analyzerArn: [, __expectNonNull(input.analyzerArn!, `analyzerArn`)],
analyzerArn: [, input.analyzerArn!],
});
let body: any;
return new __HttpRequest({
Expand Down Expand Up @@ -561,7 +561,7 @@ export const serializeAws_restJson1ListAccessPreviewsCommand = async (
const headers: any = {};
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/access-preview";
const query: any = map({
analyzerArn: [, __expectNonNull(input.analyzerArn!, `analyzerArn`)],
analyzerArn: [, input.analyzerArn!],
nextToken: [, input.nextToken!],
maxResults: [() => input.maxResults !== void 0, () => input.maxResults!.toString()],
});
Expand Down Expand Up @@ -826,10 +826,7 @@ export const serializeAws_restJson1UntagResourceCommand = async (
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", () => input.resourceArn!, "{resourceArn}", false);
const query: any = map({
tagKeys: [
__expectNonNull(input.tagKeys, `tagKeys`) != null,
() => (input.tagKeys! || []).map((_entry) => _entry as any),
],
tagKeys: [() => input.tagKeys !== void 0, () => (input.tagKeys! || []).map((_entry) => _entry as any)],
});
let body: any;
return new __HttpRequest({
Expand Down
5 changes: 1 addition & 4 deletions clients/client-amp/src/protocols/Aws_restJson1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -573,10 +573,7 @@ export const serializeAws_restJson1UntagResourceCommand = async (
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", () => input.resourceArn!, "{resourceArn}", false);
const query: any = map({
tagKeys: [
__expectNonNull(input.tagKeys, `tagKeys`) != null,
() => (input.tagKeys! || []).map((_entry) => _entry as any),
],
tagKeys: [() => input.tagKeys !== void 0, () => (input.tagKeys! || []).map((_entry) => _entry as any)],
});
let body: any;
return new __HttpRequest({
Expand Down
5 changes: 1 addition & 4 deletions clients/client-amplify/src/protocols/Aws_restJson1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -967,10 +967,7 @@ export const serializeAws_restJson1UntagResourceCommand = async (
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", () => input.resourceArn!, "{resourceArn}", false);
const query: any = map({
tagKeys: [
__expectNonNull(input.tagKeys, `tagKeys`) != null,
() => (input.tagKeys! || []).map((_entry) => _entry as any),
],
tagKeys: [() => input.tagKeys !== void 0, () => (input.tagKeys! || []).map((_entry) => _entry as any)],
});
let body: any;
return new __HttpRequest({
Expand Down
11 changes: 4 additions & 7 deletions clients/client-api-gateway/src/protocols/Aws_restJson1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2393,8 +2393,8 @@ export const serializeAws_restJson1GetUsageCommand = async (
resolvedPath = __resolvedPath(resolvedPath, input, "usagePlanId", () => input.usagePlanId!, "{usagePlanId}", false);
const query: any = map({
keyId: [, input.keyId!],
startDate: [, __expectNonNull(input.startDate!, `startDate`)],
endDate: [, __expectNonNull(input.endDate!, `endDate`)],
startDate: [, input.startDate!],
endDate: [, input.endDate!],
position: [, input.position!],
limit: [() => input.limit !== void 0, () => input.limit!.toString()],
});
Expand Down Expand Up @@ -2561,7 +2561,7 @@ export const serializeAws_restJson1ImportApiKeysCommand = async (
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/apikeys";
const query: any = map({
mode: [, "import"],
format: [, __expectNonNull(input.format!, `format`)],
format: [, input.format!],
failonwarnings: [() => input.failOnWarnings !== void 0, () => input.failOnWarnings!.toString()],
});
let body: any;
Expand Down Expand Up @@ -2993,10 +2993,7 @@ export const serializeAws_restJson1UntagResourceCommand = async (
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", () => input.resourceArn!, "{resourceArn}", false);
const query: any = map({
tagKeys: [
__expectNonNull(input.tagKeys, `tagKeys`) != null,
() => (input.tagKeys! || []).map((_entry) => _entry as any),
],
tagKeys: [() => input.tagKeys !== void 0, () => (input.tagKeys! || []).map((_entry) => _entry as any)],
});
let body: any;
return new __HttpRequest({
Expand Down
7 changes: 2 additions & 5 deletions clients/client-apigatewayv2/src/protocols/Aws_restJson1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1041,7 +1041,7 @@ export const serializeAws_restJson1ExportApiCommand = async (
const query: any = map({
exportVersion: [, input.ExportVersion!],
includeExtensions: [() => input.IncludeExtensions !== void 0, () => input.IncludeExtensions!.toString()],
outputType: [, __expectNonNull(input.OutputType!, `OutputType`)],
outputType: [, input.OutputType!],
stageName: [, input.StageName!],
});
let body: any;
Expand Down Expand Up @@ -1846,10 +1846,7 @@ export const serializeAws_restJson1UntagResourceCommand = async (
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v2/tags/{ResourceArn}";
resolvedPath = __resolvedPath(resolvedPath, input, "ResourceArn", () => input.ResourceArn!, "{ResourceArn}", false);
const query: any = map({
tagKeys: [
__expectNonNull(input.TagKeys, `TagKeys`) != null,
() => (input.TagKeys! || []).map((_entry) => _entry as any),
],
tagKeys: [() => input.TagKeys !== void 0, () => (input.TagKeys! || []).map((_entry) => _entry as any)],
});
let body: any;
return new __HttpRequest({
Expand Down
6 changes: 3 additions & 3 deletions clients/client-app-mesh/src/protocols/Aws_restJson1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1092,7 +1092,7 @@ export const serializeAws_restJson1ListTagsForResourceCommand = async (
const headers: any = {};
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v20190125/tags";
const query: any = map({
resourceArn: [, __expectNonNull(input.resourceArn!, `resourceArn`)],
resourceArn: [, input.resourceArn!],
nextToken: [, input.nextToken!],
limit: [() => input.limit !== void 0, () => input.limit!.toString()],
});
Expand Down Expand Up @@ -1230,7 +1230,7 @@ export const serializeAws_restJson1TagResourceCommand = async (
};
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v20190125/tag";
const query: any = map({
resourceArn: [, __expectNonNull(input.resourceArn!, `resourceArn`)],
resourceArn: [, input.resourceArn!],
});
let body: any;
body = JSON.stringify({
Expand Down Expand Up @@ -1258,7 +1258,7 @@ export const serializeAws_restJson1UntagResourceCommand = async (
};
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v20190125/untag";
const query: any = map({
resourceArn: [, __expectNonNull(input.resourceArn!, `resourceArn`)],
resourceArn: [, input.resourceArn!],
});
let body: any;
body = JSON.stringify({
Expand Down
9 changes: 3 additions & 6 deletions clients/client-appconfig/src/protocols/Aws_restJson1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,7 @@ export const serializeAws_restJson1GetConfigurationCommand = async (
false
);
const query: any = map({
client_id: [, __expectNonNull(input.ClientId!, `ClientId`)],
client_id: [, input.ClientId!],
client_configuration_version: [, input.ClientConfigurationVersion!],
});
let body: any;
Expand Down Expand Up @@ -1357,10 +1357,7 @@ export const serializeAws_restJson1UntagResourceCommand = async (
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{ResourceArn}";
resolvedPath = __resolvedPath(resolvedPath, input, "ResourceArn", () => input.ResourceArn!, "{ResourceArn}", false);
const query: any = map({
tagKeys: [
__expectNonNull(input.TagKeys, `TagKeys`) != null,
() => (input.TagKeys! || []).map((_entry) => _entry as any),
],
tagKeys: [() => input.TagKeys !== void 0, () => (input.TagKeys! || []).map((_entry) => _entry as any)],
});
let body: any;
return new __HttpRequest({
Expand Down Expand Up @@ -1634,7 +1631,7 @@ export const serializeAws_restJson1ValidateConfigurationCommand = async (
false
);
const query: any = map({
configuration_version: [, __expectNonNull(input.ConfigurationVersion!, `ConfigurationVersion`)],
configuration_version: [, input.ConfigurationVersion!],
});
let body: any;
return new __HttpRequest({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export const serializeAws_restJson1GetLatestConfigurationCommand = async (
const headers: any = {};
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/configuration";
const query: any = map({
configuration_token: [, __expectNonNull(input.ConfigurationToken!, `ConfigurationToken`)],
configuration_token: [, input.ConfigurationToken!],
});
let body: any;
return new __HttpRequest({
Expand Down
5 changes: 1 addition & 4 deletions clients/client-appflow/src/protocols/Aws_restJson1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -768,10 +768,7 @@ export const serializeAws_restJson1UntagResourceCommand = async (
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", () => input.resourceArn!, "{resourceArn}", false);
const query: any = map({
tagKeys: [
__expectNonNull(input.tagKeys, `tagKeys`) != null,
() => (input.tagKeys! || []).map((_entry) => _entry as any),
],
tagKeys: [() => input.tagKeys !== void 0, () => (input.tagKeys! || []).map((_entry) => _entry as any)],
});
let body: any;
return new __HttpRequest({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -408,10 +408,7 @@ export const serializeAws_restJson1UntagResourceCommand = async (
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", () => input.resourceArn!, "{resourceArn}", false);
const query: any = map({
tagKeys: [
__expectNonNull(input.tagKeys, `tagKeys`) != null,
() => (input.tagKeys! || []).map((_entry) => _entry as any),
],
tagKeys: [() => input.tagKeys !== void 0, () => (input.tagKeys! || []).map((_entry) => _entry as any)],
});
let body: any;
return new __HttpRequest({
Expand Down
11 changes: 4 additions & 7 deletions clients/client-appsync/src/protocols/Aws_restJson1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -854,7 +854,7 @@ export const serializeAws_restJson1GetIntrospectionSchemaCommand = async (
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v1/apis/{apiId}/schema";
resolvedPath = __resolvedPath(resolvedPath, input, "apiId", () => input.apiId!, "{apiId}", false);
const query: any = map({
format: [, __expectNonNull(input.format!, `format`)],
format: [, input.format!],
includeDirectives: [() => input.includeDirectives !== void 0, () => input.includeDirectives!.toString()],
});
let body: any;
Expand Down Expand Up @@ -926,7 +926,7 @@ export const serializeAws_restJson1GetTypeCommand = async (
resolvedPath = __resolvedPath(resolvedPath, input, "apiId", () => input.apiId!, "{apiId}", false);
resolvedPath = __resolvedPath(resolvedPath, input, "typeName", () => input.typeName!, "{typeName}", false);
const query: any = map({
format: [, __expectNonNull(input.format!, `format`)],
format: [, input.format!],
});
let body: any;
return new __HttpRequest({
Expand Down Expand Up @@ -1151,7 +1151,7 @@ export const serializeAws_restJson1ListTypesCommand = async (
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v1/apis/{apiId}/types";
resolvedPath = __resolvedPath(resolvedPath, input, "apiId", () => input.apiId!, "{apiId}", false);
const query: any = map({
format: [, __expectNonNull(input.format!, `format`)],
format: [, input.format!],
nextToken: [, input.nextToken!],
maxResults: [() => input.maxResults !== void 0, () => input.maxResults!.toString()],
});
Expand Down Expand Up @@ -1228,10 +1228,7 @@ export const serializeAws_restJson1UntagResourceCommand = async (
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v1/tags/{resourceArn}";
resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", () => input.resourceArn!, "{resourceArn}", false);
const query: any = map({
tagKeys: [
__expectNonNull(input.tagKeys, `tagKeys`) != null,
() => (input.tagKeys! || []).map((_entry) => _entry as any),
],
tagKeys: [() => input.tagKeys !== void 0, () => (input.tagKeys! || []).map((_entry) => _entry as any)],
});
let body: any;
return new __HttpRequest({
Expand Down
23 changes: 10 additions & 13 deletions clients/client-auditmanager/src/protocols/Aws_restJson1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -664,7 +664,7 @@ export const serializeAws_restJson1DeleteAssessmentFrameworkShareCommand = async
"/assessmentFrameworkShareRequests/{requestId}";
resolvedPath = __resolvedPath(resolvedPath, input, "requestId", () => input.requestId!, "{requestId}", false);
const query: any = map({
requestType: [, __expectNonNull(input.requestType!, `requestType`)],
requestType: [, input.requestType!],
});
let body: any;
return new __HttpRequest({
Expand Down Expand Up @@ -1348,8 +1348,8 @@ export const serializeAws_restJson1ListAssessmentControlInsightsByControlDomainC
const resolvedPath =
`${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/insights/controls-by-assessment";
const query: any = map({
controlDomainId: [, __expectNonNull(input.controlDomainId!, `controlDomainId`)],
assessmentId: [, __expectNonNull(input.assessmentId!, `assessmentId`)],
controlDomainId: [, input.controlDomainId!],
assessmentId: [, input.assessmentId!],
nextToken: [, input.nextToken!],
maxResults: [() => input.maxResults !== void 0, () => input.maxResults!.toString()],
});
Expand All @@ -1374,7 +1374,7 @@ export const serializeAws_restJson1ListAssessmentFrameworksCommand = async (
const headers: any = {};
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/assessmentFrameworks";
const query: any = map({
frameworkType: [, __expectNonNull(input.frameworkType!, `frameworkType`)],
frameworkType: [, input.frameworkType!],
nextToken: [, input.nextToken!],
maxResults: [() => input.maxResults !== void 0, () => input.maxResults!.toString()],
});
Expand All @@ -1400,7 +1400,7 @@ export const serializeAws_restJson1ListAssessmentFrameworkShareRequestsCommand =
const resolvedPath =
`${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/assessmentFrameworkShareRequests";
const query: any = map({
requestType: [, __expectNonNull(input.requestType!, `requestType`)],
requestType: [, input.requestType!],
nextToken: [, input.nextToken!],
maxResults: [() => input.maxResults !== void 0, () => input.maxResults!.toString()],
});
Expand Down Expand Up @@ -1500,7 +1500,7 @@ export const serializeAws_restJson1ListControlDomainInsightsByAssessmentCommand
const resolvedPath =
`${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/insights/control-domains-by-assessment";
const query: any = map({
assessmentId: [, __expectNonNull(input.assessmentId!, `assessmentId`)],
assessmentId: [, input.assessmentId!],
nextToken: [, input.nextToken!],
maxResults: [() => input.maxResults !== void 0, () => input.maxResults!.toString()],
});
Expand All @@ -1525,7 +1525,7 @@ export const serializeAws_restJson1ListControlInsightsByControlDomainCommand = a
const headers: any = {};
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/insights/controls";
const query: any = map({
controlDomainId: [, __expectNonNull(input.controlDomainId!, `controlDomainId`)],
controlDomainId: [, input.controlDomainId!],
nextToken: [, input.nextToken!],
maxResults: [() => input.maxResults !== void 0, () => input.maxResults!.toString()],
});
Expand All @@ -1550,7 +1550,7 @@ export const serializeAws_restJson1ListControlsCommand = async (
const headers: any = {};
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/controls";
const query: any = map({
controlType: [, __expectNonNull(input.controlType!, `controlType`)],
controlType: [, input.controlType!],
nextToken: [, input.nextToken!],
maxResults: [() => input.maxResults !== void 0, () => input.maxResults!.toString()],
});
Expand All @@ -1575,7 +1575,7 @@ export const serializeAws_restJson1ListKeywordsForDataSourceCommand = async (
const headers: any = {};
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/dataSourceKeywords";
const query: any = map({
source: [, __expectNonNull(input.source!, `source`)],
source: [, input.source!],
nextToken: [, input.nextToken!],
maxResults: [() => input.maxResults !== void 0, () => input.maxResults!.toString()],
});
Expand Down Expand Up @@ -1750,10 +1750,7 @@ export const serializeAws_restJson1UntagResourceCommand = async (
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", () => input.resourceArn!, "{resourceArn}", false);
const query: any = map({
tagKeys: [
__expectNonNull(input.tagKeys, `tagKeys`) != null,
() => (input.tagKeys! || []).map((_entry) => _entry as any),
],
tagKeys: [() => input.tagKeys !== void 0, () => (input.tagKeys! || []).map((_entry) => _entry as any)],
});
let body: any;
return new __HttpRequest({
Expand Down
10 changes: 5 additions & 5 deletions clients/client-backupstorage/src/protocols/Aws_restJson1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,8 @@ export const serializeAws_restJson1NotifyObjectCompleteCommand = async (
resolvedPath = __resolvedPath(resolvedPath, input, "BackupJobId", () => input.BackupJobId!, "{BackupJobId}", false);
resolvedPath = __resolvedPath(resolvedPath, input, "UploadId", () => input.UploadId!, "{UploadId}", false);
const query: any = map({
checksum: [, __expectNonNull(input.ObjectChecksum!, `ObjectChecksum`)],
"checksum-algorithm": [, __expectNonNull(input.ObjectChecksumAlgorithm!, `ObjectChecksumAlgorithm`)],
checksum: [, input.ObjectChecksum!],
"checksum-algorithm": [, input.ObjectChecksumAlgorithm!],
"metadata-string": [, input.MetadataString!],
"metadata-blob-length": [() => input.MetadataBlobLength !== void 0, () => input.MetadataBlobLength!.toString()],
"metadata-checksum": [, input.MetadataBlobChecksum!],
Expand Down Expand Up @@ -269,9 +269,9 @@ export const serializeAws_restJson1PutChunkCommand = async (
false
);
const query: any = map({
length: [__expectNonNull(input.Length, `Length`) != null, () => input.Length!.toString()],
checksum: [, __expectNonNull(input.Checksum!, `Checksum`)],
"checksum-algorithm": [, __expectNonNull(input.ChecksumAlgorithm!, `ChecksumAlgorithm`)],
length: [() => input.Length !== void 0, () => input.Length!.toString()],
checksum: [, input.Checksum!],
"checksum-algorithm": [, input.ChecksumAlgorithm!],
});
let body: any;
if (input.Data !== undefined) {
Expand Down

0 comments on commit 3a5313a

Please sign in to comment.